# CSharpSnippets C# snippets for Sublime Text. ## Installation ### From Package Control Recommended method of installation. Search for **C# Snippets** or just **C#**. ### Linux ``` git clone git://github.com/etic/CSharpSnippets.git ~/.config/sublime-text-3/Packages ``` ### OSX ``` git clone git://github.com/etic/CSharpSnippets.git ~/Library/Application Support/Sublime Text 3/Packages ``` ### Windows ``` git clone git://github.com/etic/CSharpSnippets.git %userprofile%\AppData\Roaming\Sublime Text 3\Packages ``` ## Code Snippets ### [case] Case ``` case ${1:Constant}: ${0} break; ``` ### [class] Class ``` ${1:public} class ${2:ClassName} { ${0} } ``` ### [ctor] Constructor ``` ${1:public} ${2:ClassName} (${3:Parameters}) { ${0} } ``` ### [default] Default ``` default: ${0} break; ``` ### [delegate] Delegate ``` public delegate ${1:ReturnType} ${2:DelegateName}(${3:Parameters}); ``` ### [else] Else ``` else { ${0} } ``` ### [elseif] Else If ``` else if (${1:Condition}) { ${0} } ``` ### [for] For ``` for (${1:Initializer}; ${2:Condition}; ${3:Update}) { ${0} } ``` ### [fact] xUnit Test Method ``` [Fact] ${1:public} void ${2:TestName}() { //Given //When //Then }${0} ``` ### [foreach] ForEach ``` foreach (${1:Type} in ${2:Collection}) { ${0} } ``` ### [if] If ``` if (${1:Condition}) { ${0} } ``` ### [interface] Interface ``` interface ${1:InterfaceName} { ${0} } ``` ### [ns] Namespace ``` namespace ${1:NamespaceName} { ${0} } ``` ### [pm] Private Method ``` private ${1:ReturnType} ${2:MethodName}(${3:Parameters}) { ${0} } ``` ### [pr] Property (Read-Only) ``` ${3:public} ${1:Type} ${2:PropertyName} { get; private set; }${0} ``` ### [prop] Property (Read-Write) ``` ${1:public} ${2:Type} ${3:PropertyName} { get; set; }${0} ``` ### [pum] Public Method ``` public ${1:ReturnType} ${2:MethodName}(${3:Parameters}) { ${0} } ``` ### [struct] Struct ``` ${1:public} struct ${2:StructName} { ${0} } ``` ### [switch] Switch ``` switch (${1:Expression}) { ${0} } ``` ### [try] Try / Catch / Finally ``` try { ${1} } catch {${2:System.Exception} e) { ${3} } finally { ${0} } ``` ### [us] Using ``` using ${1:System}; ``` ### [while] While ``` while (${1:Condition}) { ${0} } ``` ## Documentation Snippets ### [c] C documentation tag ``` ${1} ``` ### [code] Code documentation tag ``` /// /// ${1} /// ``` ### [example] Example documentation tag ``` /// /// ${1} /// ``` ### [exception] Exception documentation tag ``` /// ${2} ``` ### [include] Include documentation tag ``` /// ``` ### [list] List documentation tag ``` /// /// ${2} /// ``` ### [description] List description documentation tag ``` /// ${1} ``` ### [listheader] Listheader documentation tag ``` /// /// ${1} /// ``` ### [item] List item documentation tag ``` /// /// ${1} /// ``` ### [term] List term documentation tag ``` /// ${1} ``` ### [para] Para documentation tag ``` /// ${1} ``` ### [param] Param documentation tag ``` /// ${2} ``` ### [paramref] Paramref documentation tag ``` /// ``` ### [permission] Permission documentation tag ``` /// $2} ``` ### [remarks] Remarks documentation tag ``` /// /// ${1} /// ``` ### [returns] Returns documentation tag ``` /// ${1} ``` ### [see] See documentation tag ``` ``` ### [seealso] Seealso documentation tag ``` /// ``` ### [summary] Summary documentation tag ``` /// /// ${1} /// ``` ### [typeparam] Typeparam documentation tag ``` /// ${2} ``` ### [typeparamref] Typeparamref documentation tag ``` ``` ### [value] Value documentation tag ``` /// ${1} ``` ## License MIT