diff --git a/snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs b/snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs index a0d24d22eb9..11dc1223b87 100644 --- a/snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs +++ b/snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs @@ -1,18 +1,16 @@ // - using System; using System.Collections; using System.Collections.Specialized; using System.Diagnostics; -public class App { - +public class App +{ private static PerformanceCounter avgCounter64Sample; private static PerformanceCounter avgCounter64SampleBase; public static void Main() { - ArrayList samplesList = new ArrayList(); // If the category does not exist, create the category and exit. diff --git a/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs b/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs index eb107adc585..09d084e1d4a 100644 --- a/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs +++ b/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs @@ -1,5 +1,4 @@ // - using System; using System.Diagnostics; using System.Globalization; diff --git a/snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs b/snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs index a973337c574..a6b02ebaa7d 100644 --- a/snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs +++ b/snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs @@ -16,7 +16,6 @@ public class App { private static PerformanceCounter PC; - public static void Main() { ArrayList samplesList = new ArrayList(); @@ -26,12 +25,10 @@ public static void Main() CollectSamples(samplesList); } - private static bool SetupCategory() { if ( !PerformanceCounterCategory.Exists("ElapsedTimeSampleCategory") ) { - CounterCreationDataCollection CCDC = new CounterCreationDataCollection(); // Add the counter. @@ -60,12 +57,10 @@ private static void CreateCounters() PC = new PerformanceCounter("ElapsedTimeSampleCategory", "ElapsedTimeSample", false); - } private static void CollectSamples(ArrayList samplesList) { - long pcValue; DateTime Start; @@ -98,7 +93,6 @@ private static void CollectSamples(ArrayList samplesList) Console.WriteLine("Elapsed time = " + DateTime.Now.Subtract(Start).ToString()); } - private static void OutputSample(CounterSample s) { @@ -115,7 +109,6 @@ private static void OutputSample(CounterSample s) Console.WriteLine("++++++++++++++++++++++"); } - // Reads the counter information to enable setting the RawValue. [DllImport("Kernel32.dll")] public static extern bool QueryPerformanceCounter(out long value); @@ -126,7 +119,6 @@ private static void OutputSample(CounterSample s) // Build sample for Whidbey or higher. // - using System; using System.Collections; using System.Collections.Specialized; @@ -135,7 +127,6 @@ private static void OutputSample(CounterSample s) public class App { - public static void Main() { CollectSamples(); diff --git a/snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs b/snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs index 9070069816e..ec9d24568aa 100644 --- a/snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs +++ b/snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs @@ -8,7 +8,6 @@ // The sort command results are displayed to the user on the console. // - using System; using System.IO; using System.Diagnostics; diff --git a/snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs b/snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs index 64a37dc1019..2253ee5c06d 100644 --- a/snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs +++ b/snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs @@ -1,5 +1,4 @@ // - using System; using System.Windows.Forms; using System.Drawing; diff --git a/snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs b/snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs index 9c569dc1484..b579c0f2fa0 100644 --- a/snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs +++ b/snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs @@ -1,5 +1,4 @@ // - using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -12,7 +11,6 @@ namespace Microsoft.Samples.MoveTo.CS { - class Program { private static string sourcePath = Environment.GetFolderPath diff --git a/snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs b/snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs index a2f4a652b28..2fe6cedccde 100644 --- a/snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs +++ b/snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs @@ -1,5 +1,4 @@ // - using System; using System.Messaging; @@ -38,5 +37,4 @@ public static void UseQueue() // } } - // diff --git a/snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs b/snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs index 40c0f1b2459..ce22e58ae88 100644 --- a/snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs +++ b/snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs @@ -1,5 +1,4 @@ // - using System; using System.Messaging; diff --git a/snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs b/snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs index d559f203819..dd8eef61b35 100644 --- a/snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs +++ b/snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs @@ -1,5 +1,4 @@ // - using System; using System.Messaging; diff --git a/snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs b/snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs index c2db838ca61..390459c5f41 100644 --- a/snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs +++ b/snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs @@ -1,5 +1,4 @@ // - using System; using System.Messaging; diff --git a/snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs b/snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs index 643df19f10c..339b39047f8 100644 --- a/snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs +++ b/snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs @@ -8,7 +8,6 @@ // available. // - using System; using System.Net; using System.Net.Sockets; diff --git a/snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs b/snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs index 06848988918..68c1bc30c20 100644 --- a/snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs +++ b/snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs @@ -7,17 +7,14 @@ input string into the correct internal format. */ // - using System; using System.Net; using System.Net.Sockets; class IsLoopbackTest { - private static void Main(string[] args) { - if (args.Length == 0) { // No parameters entered. Display program usage. diff --git a/snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs b/snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs index dc574a51d16..b39f09890a2 100644 --- a/snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs +++ b/snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs @@ -9,7 +9,6 @@ */ // // - using System; using System.Net; using System.IO; diff --git a/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs b/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs index 1cb4693a256..8723e4b2e02 100644 --- a/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs +++ b/snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs @@ -1,5 +1,4 @@ // - using System; using System.Text; using System.Threading; @@ -296,7 +295,4 @@ public static void Main() { new object[0]); } } - - - // diff --git a/snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs b/snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs index d25d0e9502b..5e28943508a 100644 --- a/snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs +++ b/snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs @@ -17,7 +17,6 @@ in the main method. */ // // // - using System; using System.Collections; using System.Threading; diff --git a/snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs b/snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs index 8811e352582..884dc1d9e32 100644 --- a/snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs +++ b/snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs @@ -13,7 +13,6 @@ custom attributes of the Enum type and displays its contents on the console. */ // - using System; using System.Threading; using System.Reflection; diff --git a/snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs b/snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs index d5b9857e9c8..db9aae0821d 100644 --- a/snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs +++ b/snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs @@ -1,14 +1,11 @@ // - using System; using System.Threading; using System.Reflection; using System.Reflection.Emit; class DynamicJumpTableDemo - { - public static Type BuildMyType() { AppDomain myDomain = Thread.GetDomain(); @@ -110,5 +107,4 @@ public static void Main() new object[] {theValue})); } } - // diff --git a/snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs b/snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs index 3e407968bbb..fc4246c4da5 100644 --- a/snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs +++ b/snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs @@ -3,14 +3,11 @@ using System.Reflection.Emit; class MyDynamicAssembly - { - public static void BuildDynamicMethod(TypeBuilder myTypeBuilder, Type[] mthdParamTypes, Type returnType, int addrOfLegacyNumberObject) - { // MethodBuilder myMthdBuilder = myTypeBuilder.DefineMethod("MyMethod", diff --git a/snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs b/snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs index 9d1924a146e..957a5def854 100644 --- a/snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs +++ b/snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs @@ -1,14 +1,13 @@ // - using System; using System.Threading; using System.Reflection; using System.Reflection.Emit; -class TestILGenerator { - - public static Type DynamicDotProductGen() { - +class TestILGenerator +{ + public static Type DynamicDotProductGen() + { Type ivType = null; Type[] ctorParams = new Type[] { typeof(int), typeof(int), @@ -179,5 +178,4 @@ public static void Main() { // (10, 10, 10) . (20, 20, 20) = 600 } } - // diff --git a/snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs b/snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs index c45eed4c0e7..2a2860752dd 100644 --- a/snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs +++ b/snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs @@ -1,14 +1,11 @@ // - using System; using System.Threading; using System.Reflection; using System.Reflection.Emit; class PropertyBuilderDemo - { - public static Type BuildDynamicTypeWithProperties() { AppDomain myDomain = Thread.GetDomain(); diff --git a/snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs b/snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs index 84720e74426..1dfc6362b06 100644 --- a/snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs +++ b/snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs @@ -1,5 +1,4 @@ // - using System; using System.Reflection; using System.Reflection.Emit; @@ -96,5 +95,4 @@ public Assembly ResolveEvent(Object sender, ResolveEventArgs args) return m_Module.Assembly; } } - // diff --git a/snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs b/snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs index e5541a04887..9fac46e234a 100644 --- a/snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs +++ b/snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs @@ -20,7 +20,6 @@ assembly is also saved to a file named 'MyAssembly.exe'. // // // - using System; using System.Reflection; using System.Threading; @@ -54,7 +53,6 @@ public static void MakeAssembly(AssemblyName myAssemblyName, string fileName) public static void Main() { - // Create a dynamic assembly with name 'MyAssembly' and build version '1.0.0.2001'. AssemblyName myAssemblyName = new AssemblyName(); myAssemblyName.Name = "MyAssembly"; diff --git a/snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs b/snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs index f3119c5460b..9833729fade 100644 --- a/snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs +++ b/snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs @@ -1,9 +1,8 @@ // - using System; using System.Reflection; - //Make two fields, one public and one read-only. +//Make two fields, one public and one read-only. public class Myfielda { public string field = "A - public modifiable field"; diff --git a/snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs b/snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs index a93d9647827..246809ab6fb 100644 --- a/snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs +++ b/snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs @@ -1,5 +1,4 @@ // - using System; using System.Reflection; diff --git a/snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs b/snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs index 864f86dd49b..5a56b9624ae 100644 --- a/snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs +++ b/snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs @@ -14,7 +14,6 @@ then the attributes of all the parameters of the method named 'MyMethod' is // // // - using System; using System.Reflection; using System.Threading; diff --git a/snippets/csharp/System.Runtime.InteropServices/Marshal/GetActiveObject/marshal.getactiveobject.cs b/snippets/csharp/System.Runtime.InteropServices/Marshal/GetActiveObject/marshal.getactiveobject.cs index 8fa1859b26f..677cd1c971c 100644 --- a/snippets/csharp/System.Runtime.InteropServices/Marshal/GetActiveObject/marshal.getactiveobject.cs +++ b/snippets/csharp/System.Runtime.InteropServices/Marshal/GetActiveObject/marshal.getactiveobject.cs @@ -1,5 +1,4 @@ // - using System; using System.Runtime.InteropServices; diff --git a/snippets/csharp/System.Runtime.InteropServices/TypeLibVarAttribute/Overview/codefile6.cs b/snippets/csharp/System.Runtime.InteropServices/TypeLibVarAttribute/Overview/codefile6.cs index b86c66b0292..4a21162017e 100644 --- a/snippets/csharp/System.Runtime.InteropServices/TypeLibVarAttribute/Overview/codefile6.cs +++ b/snippets/csharp/System.Runtime.InteropServices/TypeLibVarAttribute/Overview/codefile6.cs @@ -1,7 +1,6 @@ // System.Runtime.InteropServices.TypeLibVarAttribute // System.Runtime.InteropServices.TypeLibVarFlags // - using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/snippets/csharp/System.Runtime.Remoting.Channels/ITransportHeaders/Overview/itransportheaders_3_server.cs b/snippets/csharp/System.Runtime.Remoting.Channels/ITransportHeaders/Overview/itransportheaders_3_server.cs index 12e876d06dd..6c2be73dccd 100644 --- a/snippets/csharp/System.Runtime.Remoting.Channels/ITransportHeaders/Overview/itransportheaders_3_server.cs +++ b/snippets/csharp/System.Runtime.Remoting.Channels/ITransportHeaders/Overview/itransportheaders_3_server.cs @@ -9,7 +9,6 @@ interface. It then adds a few headers to the header list and displays them. */ // - using System; using System.Collections; using System.Runtime.Remoting; @@ -88,5 +87,4 @@ public static void Main() // // } - // \ No newline at end of file diff --git a/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerserver.cs b/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerserver.cs index 65ad92e463c..b5bc2ef2d8e 100644 --- a/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerserver.cs +++ b/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerserver.cs @@ -1,5 +1,4 @@ // - using System; using System.Collections; using System.Runtime.Remoting; @@ -31,5 +30,4 @@ public static void Main() { } } } - // \ No newline at end of file diff --git a/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerservice.cs b/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerservice.cs index f415156a388..6e36c55c862 100644 --- a/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerservice.cs +++ b/snippets/csharp/System.Runtime.Remoting/RemotingServices/GetLifetimeService/timerservice.cs @@ -1,5 +1,4 @@ // - using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; diff --git a/snippets/csharp/System.Security.Claims/AuthorizationContext/Overview/resourceaction.cs b/snippets/csharp/System.Security.Claims/AuthorizationContext/Overview/resourceaction.cs index d45256427f7..e306e56ebd1 100644 --- a/snippets/csharp/System.Security.Claims/AuthorizationContext/Overview/resourceaction.cs +++ b/snippets/csharp/System.Security.Claims/AuthorizationContext/Overview/resourceaction.cs @@ -10,7 +10,6 @@ // //----------------------------------------------------------------------------- // - using System; namespace ClaimsAuthorizationLibrary diff --git a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/CreateFromCertFile/example.cs b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/CreateFromCertFile/example.cs index 7d785fe8853..8deff5f2885 100644 --- a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/CreateFromCertFile/example.cs +++ b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/CreateFromCertFile/example.cs @@ -1,14 +1,11 @@ // - using System; using System.Security.Cryptography.X509Certificates; public class X509 { - public static void Main() { - // The path to the certificate. string Certificate = "Certificate.cer"; diff --git a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetExpirationDateString/example.cs b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetExpirationDateString/example.cs index 6dc1f7b2129..c5976c0eae1 100644 --- a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetExpirationDateString/example.cs +++ b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetExpirationDateString/example.cs @@ -1,14 +1,11 @@ // - using System; using System.Security.Cryptography.X509Certificates; public class X509 { - public static void Main() { - // The path to the certificate. string Certificate = "Certificate.cer"; diff --git a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetIssuerName/example.cs b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetIssuerName/example.cs index 5f42c352baf..e409c5f4b38 100644 --- a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetIssuerName/example.cs +++ b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetIssuerName/example.cs @@ -1,14 +1,11 @@ // - using System; using System.Security.Cryptography.X509Certificates; public class X509 { - public static void Main() { - // The path to the certificate. string Certificate = "Certificate.cer"; diff --git a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithm/example.cs b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithm/example.cs index a369e94f01e..17660b61e15 100644 --- a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithm/example.cs +++ b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithm/example.cs @@ -1,14 +1,11 @@ // - using System; using System.Security.Cryptography.X509Certificates; public class X509 { - public static void Main() { - // The path to the certificate. string Certificate = "Certificate.cer"; diff --git a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithmParameters/example.cs b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithmParameters/example.cs index ae52f101b48..ccc6fb9bde7 100644 --- a/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithmParameters/example.cs +++ b/snippets/csharp/System.Security.Cryptography.X509Certificates/X509Certificate/GetKeyAlgorithmParameters/example.cs @@ -1,14 +1,11 @@ // - using System; using System.Security.Cryptography.X509Certificates; public class X509 { - public static void Main() { - // The path to the certificate. string Certificate = "Certificate.cer"; diff --git a/snippets/csharp/System.Security.Cryptography.Xml/DataReference/Overview/sample.cs b/snippets/csharp/System.Security.Cryptography.Xml/DataReference/Overview/sample.cs index 662966c5d87..f679cf29b54 100644 --- a/snippets/csharp/System.Security.Cryptography.Xml/DataReference/Overview/sample.cs +++ b/snippets/csharp/System.Security.Cryptography.Xml/DataReference/Overview/sample.cs @@ -1,5 +1,4 @@ // - using System; using System.Xml; using System.Security.Cryptography; @@ -9,7 +8,6 @@ class Program { static void Main(string[] args) { - // Create an XmlDocument object. XmlDocument xmlDoc = new XmlDocument(); diff --git a/snippets/csharp/System.Security.Cryptography.Xml/KeyReference/Overview/sample.cs b/snippets/csharp/System.Security.Cryptography.Xml/KeyReference/Overview/sample.cs index 43df8eaf934..9e0e685dadf 100644 --- a/snippets/csharp/System.Security.Cryptography.Xml/KeyReference/Overview/sample.cs +++ b/snippets/csharp/System.Security.Cryptography.Xml/KeyReference/Overview/sample.cs @@ -1,5 +1,4 @@ // - using System; using System.Xml; using System.Security.Cryptography; @@ -9,7 +8,6 @@ class Program { static void Main(string[] args) { - // Create an XmlDocument object. XmlDocument xmlDoc = new XmlDocument(); diff --git a/snippets/csharp/System.Security.Cryptography/FromBase64Transform/Overview/class1.cs b/snippets/csharp/System.Security.Cryptography/FromBase64Transform/Overview/class1.cs index 12e65c54e7f..761ef1c3f38 100644 --- a/snippets/csharp/System.Security.Cryptography/FromBase64Transform/Overview/class1.cs +++ b/snippets/csharp/System.Security.Cryptography/FromBase64Transform/Overview/class1.cs @@ -1,5 +1,4 @@ // - using System; using System.IO; using System.Security.Cryptography; diff --git a/snippets/csharp/System.Security.Permissions/StrongNameIdentityPermission/.ctor/strongnameidentity.cs b/snippets/csharp/System.Security.Permissions/StrongNameIdentityPermission/.ctor/strongnameidentity.cs index 10b041a8394..98d53c351d3 100644 --- a/snippets/csharp/System.Security.Permissions/StrongNameIdentityPermission/.ctor/strongnameidentity.cs +++ b/snippets/csharp/System.Security.Permissions/StrongNameIdentityPermission/.ctor/strongnameidentity.cs @@ -1,5 +1,4 @@ // - using System; using System.Security; using System.Security.Permissions; @@ -225,5 +224,4 @@ public static void Main(String[] args) } } } - // diff --git a/snippets/csharp/System.Security.Policy/Evidence/Overview/evidence_evidence.cs b/snippets/csharp/System.Security.Policy/Evidence/Overview/evidence_evidence.cs index f3db54d1599..4fdb129e84f 100644 --- a/snippets/csharp/System.Security.Policy/Evidence/Overview/evidence_evidence.cs +++ b/snippets/csharp/System.Security.Policy/Evidence/Overview/evidence_evidence.cs @@ -1,5 +1,4 @@ // - using System; using System.Collections; using System.Security; diff --git a/snippets/csharp/System.Threading.Tasks/Parallel/Overview/parallelforcancel.cs b/snippets/csharp/System.Threading.Tasks/Parallel/Overview/parallelforcancel.cs index 26a8f450c6a..5e40e2a5e61 100644 --- a/snippets/csharp/System.Threading.Tasks/Parallel/Overview/parallelforcancel.cs +++ b/snippets/csharp/System.Threading.Tasks/Parallel/Overview/parallelforcancel.cs @@ -1,5 +1,4 @@ // - using System; using System.Collections.Generic; using System.Linq; diff --git a/snippets/csharp/System.Web.Services.Discovery/SoapBinding/Overview/discovery_soapbinding.cs b/snippets/csharp/System.Web.Services.Discovery/SoapBinding/Overview/discovery_soapbinding.cs index 06cb499e70e..4eeea371184 100644 --- a/snippets/csharp/System.Web.Services.Discovery/SoapBinding/Overview/discovery_soapbinding.cs +++ b/snippets/csharp/System.Web.Services.Discovery/SoapBinding/Overview/discovery_soapbinding.cs @@ -11,7 +11,6 @@ */ // - using System; using System.Net; using System.Security.Permissions; diff --git a/snippets/csharp/System.Windows.Forms/KeyPressEventArgs/Handled/form1.cs b/snippets/csharp/System.Windows.Forms/KeyPressEventArgs/Handled/form1.cs index 36d883561a9..7ffdb27f6ca 100644 --- a/snippets/csharp/System.Windows.Forms/KeyPressEventArgs/Handled/form1.cs +++ b/snippets/csharp/System.Windows.Forms/KeyPressEventArgs/Handled/form1.cs @@ -1,5 +1,4 @@ // - using System; using System.Windows.Forms; diff --git a/snippets/csharp/System.Xml.Serialization/XmlSerializer/Serialize/source3.cs b/snippets/csharp/System.Xml.Serialization/XmlSerializer/Serialize/source3.cs index 2b4e90bbe70..14f10639cc1 100644 --- a/snippets/csharp/System.Xml.Serialization/XmlSerializer/Serialize/source3.cs +++ b/snippets/csharp/System.Xml.Serialization/XmlSerializer/Serialize/source3.cs @@ -1,5 +1,4 @@ // - using System; using System.IO; using System.Xml.Serialization; @@ -91,5 +90,4 @@ private void DeserializeObject(string filename) i.LineTotal); } } - // diff --git a/snippets/csharp/System/AppDomain/CreateInstanceAndUnwrap/addyno.cs b/snippets/csharp/System/AppDomain/CreateInstanceAndUnwrap/addyno.cs index 189307805bd..5259af7f71a 100644 --- a/snippets/csharp/System/AppDomain/CreateInstanceAndUnwrap/addyno.cs +++ b/snippets/csharp/System/AppDomain/CreateInstanceAndUnwrap/addyno.cs @@ -1,5 +1,4 @@ // - using System; using System.IO; using System.Threading; @@ -8,13 +7,10 @@ using System.Runtime.Remoting; class ADDyno - { - public static Type CreateADynamicAssembly(ref AppDomain myNewDomain, string executableNameNoExe) { - string executableName = executableNameNoExe + ".exe"; AssemblyName myAsmName = new AssemblyName(); @@ -171,5 +167,4 @@ public static void Main() myObjInstance, new object[] { }); } } - // diff --git a/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor2.cs b/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor2.cs index 7752045456d..1b6fa2a1723 100644 --- a/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor2.cs +++ b/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor2.cs @@ -9,7 +9,6 @@ created which takes two arrays as arguments. It checks whether the two arrays caught in the calling method. */ // - using System; public class ArrayTypeMismatchConst2 diff --git a/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs b/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs index dce42823e44..81a97100f96 100644 --- a/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs +++ b/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs @@ -10,7 +10,6 @@ object is created and thrown to the caller. That exception is caught in the calling method and the error message is displayed to the console. */ // - using System; public class ArrayTypeMismatchConst3 diff --git a/snippets/csharp/System/Type/GetConstructor/type_getconstructor.cs b/snippets/csharp/System/Type/GetConstructor/type_getconstructor.cs index d808bcde6aa..9085a6089a5 100644 --- a/snippets/csharp/System/Type/GetConstructor/type_getconstructor.cs +++ b/snippets/csharp/System/Type/GetConstructor/type_getconstructor.cs @@ -1,5 +1,4 @@ // - using System; using System.Reflection; diff --git a/snippets/csharp/System/Type/GetDefaultMembers/type_getdefaultmembers.cs b/snippets/csharp/System/Type/GetDefaultMembers/type_getdefaultmembers.cs index 981899739ff..11ac59b32f6 100644 --- a/snippets/csharp/System/Type/GetDefaultMembers/type_getdefaultmembers.cs +++ b/snippets/csharp/System/Type/GetDefaultMembers/type_getdefaultmembers.cs @@ -1,5 +1,4 @@ // - using System; using System.Reflection; using System.IO; diff --git a/snippets/csharp/System/Type/GetMethod/type_getmethod2.cs b/snippets/csharp/System/Type/GetMethod/type_getmethod2.cs index f2f2e769d73..90bca4d28cb 100644 --- a/snippets/csharp/System/Type/GetMethod/type_getmethod2.cs +++ b/snippets/csharp/System/Type/GetMethod/type_getmethod2.cs @@ -1,17 +1,14 @@ // - using System; using System.Reflection; class Program2 { - // Method to get: public void MethodA() { } static void Main(string[] args) { - // Get MethodA() MethodInfo mInfo = typeof(Program).GetMethod("MethodA", BindingFlags.Public | BindingFlags.Instance); diff --git a/snippets/csharp/System/Type/GetMethods/type_getmethods2.cs b/snippets/csharp/System/Type/GetMethods/type_getmethods2.cs index b836b275e4f..f50aed0e5f4 100644 --- a/snippets/csharp/System/Type/GetMethods/type_getmethods2.cs +++ b/snippets/csharp/System/Type/GetMethods/type_getmethods2.cs @@ -1,10 +1,9 @@ // - using System; using System.Reflection; using System.Reflection.Emit; - // Create a class having two public methods and one protected method. +// Create a class having two public methods and one protected method. public class MyTypeClass { public void MyMethods() diff --git a/snippets/csharp/System/Type/GetNestedTypes/type_getnestedtypes.cs b/snippets/csharp/System/Type/GetNestedTypes/type_getnestedtypes.cs index f867281225e..0815b133ce2 100644 --- a/snippets/csharp/System/Type/GetNestedTypes/type_getnestedtypes.cs +++ b/snippets/csharp/System/Type/GetNestedTypes/type_getnestedtypes.cs @@ -1,5 +1,4 @@ // - using System; using System.Reflection; public class MyClass diff --git a/snippets/csharp/System/Type/GetProperty/type_getproperty1.cs b/snippets/csharp/System/Type/GetProperty/type_getproperty1.cs index 55365091395..c1d1196f3c8 100644 --- a/snippets/csharp/System/Type/GetProperty/type_getproperty1.cs +++ b/snippets/csharp/System/Type/GetProperty/type_getproperty1.cs @@ -1,5 +1,4 @@ // - using System; using System.Reflection; diff --git a/snippets/csharp/System/TypeLoadException/.ctor/typeloadexception_constructor3.cs b/snippets/csharp/System/TypeLoadException/.ctor/typeloadexception_constructor3.cs index 155bd4cba34..51589e8ee66 100644 --- a/snippets/csharp/System/TypeLoadException/.ctor/typeloadexception_constructor3.cs +++ b/snippets/csharp/System/TypeLoadException/.ctor/typeloadexception_constructor3.cs @@ -7,7 +7,6 @@ constructor of 'TypeLoadException' class. It attempts to call a as an inner exception.*/ // - using System; using System.Runtime.InteropServices;