¡@

Home 

c# Programming Glossary: writeline

Performance difference for control structures 'for' and 'foreach' in C#

http://stackoverflow.com/questions/1124753/performance-difference-for-control-structures-for-and-foreach-in-c-sharp

List object list foreach object o in list Console.WriteLine o Produces IL of .method private hidebysig static void IterateOverList.. IL_0011 ldloc.0 IL_0012 call void mscorlib System.Console WriteLine object IL_0017 ldloca.s V_1 IL_0019 call instance bool valuetype.. object array foreach object o in array Console.WriteLine o Compiles into... .method private hidebysig static void IterateOverArray..

C# object dumper

http://stackoverflow.com/questions/1347375/c-sharp-object-dumper

for int i 0 i level i writer.Write private void WriteLine writer.WriteLine pos 0 private void WriteTab Write while.. i 0 i level i writer.Write private void WriteLine writer.WriteLine pos 0 private void WriteTab Write while pos 8 0 Write private.. is string WriteIndent Write prefix WriteValue element WriteLine else IEnumerable enumerableElement element as IEnumerable if..

Strange behaviour of Console.ReadKey() with multithreading

http://stackoverflow.com/questions/15143931/strange-behaviour-of-console-readkey-with-multithreading

Program private static void Main string args Console.WriteLine X Also try with this line commented out. Task.Factory.StartNew.. test Console.ReadKey private static void test Console.WriteLine Entering the test function. Thread.Sleep 1000 Console.WriteLine.. Entering the test function. Thread.Sleep 1000 Console.WriteLine Exiting the test function. What do you think that will print..

When using object initializers, why does the compiler generate an extra local variable?

http://stackoverflow.com/questions/1679780/when-using-object-initializers-why-does-the-compiler-generate-an-extra-local-va

fooBar Class2 class2 new Class2 Foo fooBar2 Console.WriteLine class1.Foo Console.WriteLine class2.Foo Using Reflector we.. Class2 Foo fooBar2 Console.WriteLine class1.Foo Console.WriteLine class2.Foo Using Reflector we can examine the code for the.. get_Foo L_002a call void mscorlib System.Console WriteLine string L_002f ldloc.1 L_0030 callvirt instance string ClassLibrary1.Class2..

Lock statement vs Monitor.Enter method

http://stackoverflow.com/questions/2837070/lock-statement-vs-monitor-enter-method

public Test string name this.name name ~Test Console.WriteLine string.Format Finalizing class name 0 . name class Program static.. var test2 new Test Tesst2 lock test1 test1 null Console.WriteLine Manual collect 1. GC.Collect GC.WaitForPendingFinalizers .. 1. GC.Collect GC.WaitForPendingFinalizers Console.WriteLine Manual collect 2. GC.Collect var lockTaken false System.Threading.Monitor.Enter..

Why can't yield return appear inside a try block with a catch?

http://stackoverflow.com/questions/346365/why-cant-yield-return-appear-inside-a-try-block-with-a-catch

try block with a catch The following is okay try Console.WriteLine Before yield return 1 Console.WriteLine After finally Console.WriteLine.. okay try Console.WriteLine Before yield return 1 Console.WriteLine After finally Console.WriteLine Done The finally block runs.. yield return 1 Console.WriteLine After finally Console.WriteLine Done The finally block runs when the whole thing has finished..

Scope of variables in C#

http://stackoverflow.com/questions/3979493/scope-of-variables-in-c-sharp

string args var a 3 if a 1 int b 2 a b var c 10 Console.WriteLine a c Generates the following IL .method private hidebysig static.. IL_0011 add IL_0012 call void mscorlib System.Console WriteLine int32 IL_0017 ret end of method Program Main One important thing..

Is there any performance difference between ++i and i++ in C#?

http://stackoverflow.com/questions/467322/is-there-any-performance-difference-between-i-and-i-in-c

void Main string args for int i 0 i counter i Console.WriteLine i for int i 0 i counter i Console.WriteLine i The generated.. i Console.WriteLine i for int i 0 i counter i Console.WriteLine i The generated IL code is the same for both loops IL_0000.. IL_0006 ldloc.0 IL_0007 call void mscorlib System.Console WriteLine int32 IL_000c ldloc.0 IL_000d ldc.i4.1 IL_000e add IL_000f stloc.0..

deserializing JSON to .net object using NewtonSoft (or linq to json maybe?)

http://stackoverflow.com/questions/4749639/deserializing-json-to-net-object-using-newtonsoft-or-linq-to-json-maybe

reader.Read .ToString foreach string item in list Console.WriteLine item Console.WriteLine reader.ReadLine stream.Close that JsonConvert.. foreach string item in list Console.WriteLine item Console.WriteLine reader.ReadLine stream.Close that JsonConvert line is just the.. reader.ReadLine instead of WriteLine 2 or 3 lines of code here using WebClient to download the file..

Post-increment Operator Overloading

http://stackoverflow.com/questions/668763/post-increment-operator-overloading

integers we get the following results. int n n 10 Console.WriteLine n 10 Console.WriteLine n 10 Console.WriteLine n 11 n 10 Console.WriteLine.. results. int n n 10 Console.WriteLine n 10 Console.WriteLine n 10 Console.WriteLine n 11 n 10 Console.WriteLine n 10 Console.WriteLine.. n 10 Console.WriteLine n 10 Console.WriteLine n 10 Console.WriteLine n 11 n 10 Console.WriteLine n 10 Console.WriteLine n 11 Console.WriteLine..

How can I update the current line in a C# Windows Console App?

http://stackoverflow.com/questions/888533/how-can-i-update-the-current-line-in-a-c-sharp-windows-console-app

before is erased. Also notice the use of Write instead of WriteLine since you don't want to add an n at the end of the line. share..