som more snippets from vs.net

onto invoke
This commit is contained in:
Gert 2015-03-26 14:35:55 +01:00
parent 984e63a7ee
commit d956ce5c55

View File

@ -90,7 +90,7 @@ snippet ?
snippet do snippet do
do { do {
${0} ${0}
} while (${1}); } while (${1:True});
# while loop # while loop
snippet wh snippet wh
while (${1}) { while (${1}) {
@ -101,6 +101,10 @@ snippet for
for (int ${1:i} = 0; $1 < ${2:count}; $1${3:++}) { for (int ${1:i} = 0; $1 < ${2:count}; $1${3:++}) {
${0} ${0}
} }
snippet forr
for (int ${1:i} = ${2:length}; $1 >= 0; $1--) {
${0}
}
# foreach # foreach
snippet fore snippet fore
foreach (${1:var} ${2:entry} in ${3}) { foreach (${1:var} ${2:entry} in ${3}) {
@ -347,6 +351,11 @@ snippet struct
} }
# enumeration # enumeration
snippet enum snippet enum
enum ${1} {
${0}
}
snippet enum+
public enum ${1} { public enum ${1} {
${0} ${0}
} }
@ -372,3 +381,39 @@ snippet <rem
<remarks>${1}</remarks> <remarks>${1}</remarks>
snippet <c snippet <c
<code>${1}</code> <code>${1}</code>
snippet cw
Console.WriteLine(${1});
# equals override
snippet eq
public override bool Equals(object obj){
if (obj == null || GetType() != obj.GetType()){
return false;
}
${0:throw new NotImplementedException();}
return base.Equals(obj);
}
# exception snippet
snippet exc
public class ${1:MyException} : ${2:Exception}{
public $1() { }
public $1(string message) : base(message) { }
public $1(string message, Exception inner) : base(message, inner) { }
protected $1(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
: base(info, context) { }
}
# indexer snippet
snippet index
public ${1:object} this[${2:int} index]{
get { ${3:} }
set { ${0:} }
}
# eventhandler snippet
snippet inv
EventHandler temp = ${1:MyEvent};
if (${2:temp} != null){
$2();
}