Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
int GetNumber() {
|
||||
return 5;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
try {
|
||||
if (someCondition) {
|
||||
throw new Exception();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LogException(ex);
|
||||
throw;
|
||||
} finally {
|
||||
cleanUp();
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
public static void Main() {
|
||||
foreach (int n in Numbers(i => i >= 2) {
|
||||
Console.WriteLine("Got " + n);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable<int> Numbers(Func<int, bool> predicate) {
|
||||
for (int i = 0; ; i++) {
|
||||
if (predicate(i)) yield break;
|
||||
Console.WriteLine("Yielding " + i);
|
||||
yield return i;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
async Task DoStuffAsync() {
|
||||
DoSomething();
|
||||
await someOtherTask;//returns control to caller if someOtherTask is not yet finished.
|
||||
DoSomethingElse();
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
while (conditionA) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (conditionB) goto NextSection;
|
||||
DoSomething(i);
|
||||
}
|
||||
}
|
||||
NextSection: DoOtherStuff();
|
||||
Loading…
Add table
Add a link
Reference in a new issue