TechSapphire Monday, 2024-04-29, 4:59 AM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Main » 2016 » September » 15 » Code snippets and steps to create custom code snippets
    9:06 AM
    Code snippets and steps to create custom code snippets

    Code snippets and steps to create custom code snippets

    Code snippets are meant as small region of reusable code. Which allow you to use intellisense to insert set of code N number of times. Below are the content you will cover in lecture. Using code snippets can save a lot of time and effort. Also help in distributing common standard code among team.

    • Code Snippets – Introduction
    • Ways to insert code snippets
    • Custom Code Snippets
    • XML File walkthrough
    • Examples
    • Using the custom snippets

    • Ready made code fragments
    • Two types
       • Expansion code snippet
       • Surround with code snippet


    Custom code snippets:
    • Steps to create custom code snippet
    • Create an XML file with extension .snippet
    • Import the snippets in Visual Studio
    • XML File boilerplate

    Download CustomerCodeSnippert.xml

    XML used for custom code snippet in video is:

    <?xml version="1.0" encoding="utf-8" ?> 
    <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/CodeSnippet">
        <CodeSnippet Format="1.0.0">
            <!-- The header contains metadata about the snippet -->
            <Header>

                <!-- The Title of the snippet, this will be shown in the snippets manager -->
                <Title></Title>

                <!-- The description of the snippet -->
                <Description></Description>
                  
                <!-- The author of the snippet -->
                <Author></Author>
                  
                <!-- The set of characters that must be keyed in to insert the snippet -->
                <Shortcut></Shortcut>
                  
                <!-- Snippet type - Expansion, SurroundsWith -->
                <SnippetTypes>
                    <SnippetType></SnippetType>
                </SnippetTypes>          
              
            </Header>
          
            <!-- Snippet code and literals, if any -->
            <Snippet>
                <!-- Specify the code language and the actual snippet content. -->
                <Code Language="CSharp">
                    <![CDATA[
                        ACTUAL SNIPPET CODE
                    ]]>
                </Code>
            </Snippet>
        </CodeSnippet>
    </CodeSnippets>

    Download CustomerCodeSnippert.xml

    Category: Programming | Views: 19004 | Added by: Admin | Tags: Visual Studio, visual studio 2008, Code snippets, visual studio 2013, visual studio 2015, visual studio 2012, Custom code snippets | Rating: 0.0/0
    Total comments: 0
    Only registered users can add comments.
    [ Registration | Login ]
    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024