Created
April 3, 2021 16:48
-
-
Save nathy-mesquita/b5d5f6f43dc2b8e86f2c6e064ff6bfb6 to your computer and use it in GitHub Desktop.
C# Snippet Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Construtor | |
/// <![CDATA[ctor]]> | |
/// </summary> | |
public ClassNamePlaceholder() | |
{ | |
} | |
/// <summary> | |
/// Classe | |
/// <![CDATA[class]]> | |
/// </summary> | |
class MyClass | |
{ | |
} | |
/// <summary> | |
/// Console WriteLine | |
/// </summary> | |
/// <![CDATA[cw]]> | |
Console.WriteLine(); | |
/// <summary> | |
/// Propriedade | |
/// </summary> | |
/// <![CDATA[prop]]> | |
public int MyProperty { get; set; } | |
/// <summary> | |
/// Propriedade completa | |
/// </summary> | |
/// <![CDATA[propfull]]> | |
private int myVar; | |
public int MyProperty | |
{ | |
get { return myVar; } | |
set { myVar = value; } | |
} | |
/// <summary> | |
/// Método Main com retorno | |
/// </summary> | |
/// <![CDATA[sim]]> | |
/// <param name="args"></param> | |
/// <returns></returns> | |
static int Main(string[] args) | |
{ | |
return 0; | |
} | |
/// <summary> | |
/// Método Main sem retorno | |
/// </summary> | |
/// <![CDATA[svm]]> | |
/// <param name="args"></param> | |
static void Main(string[] args) | |
{ | |
} | |
/// <summary> | |
/// Interface | |
/// </summary> | |
/// <![CDATA[interface]]> | |
interface IInterface | |
{ | |
} | |
/// <summary> | |
/// Exceção | |
/// </summary> | |
/// <![CDATA[exception]]> | |
[Serializable] | |
public class MyException : Exception | |
{ | |
public MyException() { } | |
public MyException(string message) : base(message) { } | |
public MyException(string message, Exception inner) : base(message, inner) { } | |
protected MyException( | |
System.Runtime.Serialization.SerializationInfo info, | |
System.Runtime.Serialization.StreamingContext context) : base(info, context) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment