From 68840bc71bc83889613689a011c01c2c7931a7d2 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:55:40 +0800 Subject: [PATCH 1/3] Remove superfluous empty lines --- .../CounterCreationData/Overview/averagecount32.cs | 6 ++---- .../EventLog/GetEventLogs/source1.cs | 1 - .../PerformanceCounter/NextValue/elapsedtime.cs | 9 --------- .../Process/StandardInput/process_standardinput.cs | 1 - .../System.Drawing/Graphics/CopyFromScreen/Form1.cs | 1 - snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs | 2 -- .../System.Messaging/MessageQueue/.ctor/class11.cs | 2 -- .../System.Messaging/MessageQueue/BeginPeek/class1.cs | 1 - .../MessageQueuePermissionAccess/Overview/class1.cs | 1 - .../MessageQueuePermissionEntry/Overview/class1.cs | 1 - .../IPv6MulticastOption/Overview/joinmulticastgroup.cs | 1 - .../MulticastOption/Overview/listener.cs | 3 --- .../System.Net/IPAddress/IsLoopback/isloopback.cs | 3 --- .../BeginGetResponse/webrequest_begingetresponse.cs | 1 - .../AssemblyBuilder/Save/source.cs | 4 ---- .../EnumBuilder/Assembly/enumbuilder_properties_5.cs | 1 - .../enumbuilder_setcustomattribute1.cs | 1 - .../System.Reflection.Emit/ILGenerator/Emit/source.cs | 4 ---- .../ILGenerator/EmitCalli/source.cs | 3 --- .../MethodBuilder/GetILGenerator/source.cs | 10 ++++------ .../PropertyBuilder/Overview/source.cs | 3 --- .../TypeBuilder/CreateType/nestedenum.cs | 2 -- .../AssemblyName/.ctor/assemblyname_constructor.cs | 2 -- .../System.Reflection/FieldInfo/IsInitOnly/source.cs | 3 +-- .../memberinfo_getcustomattribute_isdefined.cs | 1 - .../IsIn/parameterinfo_isin_isout_isoptional.cs | 1 - .../ComImportAttribute/Overview/codefile5.cs | 1 - .../Marshal/GetActiveObject/marshal.getactiveobject.cs | 1 - .../TypeLibVarAttribute/Overview/codefile6.cs | 1 - .../Overview/itransportheaders_3_server.cs | 2 -- .../RemotingServices/GetLifetimeService/timerserver.cs | 2 -- .../GetLifetimeService/timerservice.cs | 1 - .../AuthorizationContext/Overview/resourceaction.cs | 1 - .../X509Certificate/CreateFromCertFile/example.cs | 3 --- .../X509Certificate/GetExpirationDateString/example.cs | 3 --- .../X509Certificate/GetIssuerName/example.cs | 3 --- .../X509Certificate/GetKeyAlgorithm/example.cs | 3 --- .../GetKeyAlgorithmParameters/example.cs | 3 --- .../DataReference/Overview/sample.cs | 2 -- .../KeyReference/Overview/sample.cs | 2 -- .../Overview/ContosoEncryption.cs | 1 - .../FromBase64Transform/Overview/class1.cs | 1 - .../.ctor/strongnameidentity.cs | 2 -- .../Evidence/Overview/evidence_evidence.cs | 1 - .../Parallel/Overview/parallelforcancel.cs | 1 - .../SoapBinding/Overview/discovery_soapbinding.cs | 1 - .../KeyPressEventArgs/Handled/form1.cs | 1 - .../XmlSerializer/Serialize/source3.cs | 2 -- .../System/AppDomain/CreateInstanceAndUnwrap/addyno.cs | 5 ----- .../.ctor/arraytypemismatch_constructor2.cs | 1 - .../.ctor/arraytypemismatch_constructor3.cs | 1 - .../System/Type/GetConstructor/type_getconstructor.cs | 1 - .../Type/GetDefaultMembers/type_getdefaultmembers.cs | 1 - .../csharp/System/Type/GetMethod/type_getmethod2.cs | 3 --- .../csharp/System/Type/GetMethods/type_getmethods2.cs | 3 +-- .../System/Type/GetNestedTypes/type_getnestedtypes.cs | 1 - .../System/Type/GetProperty/type_getproperty1.cs | 1 - .../.ctor/typeloadexception_constructor3.cs | 1 - .../csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs | 4 +--- .../VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs | 1 - .../CS/SimpleCustomControl.cs | 5 ----- .../FilterableAttribute_2/CS/simplecustomcontrol.cs | 1 - .../CS/htmltextwriter_methods3.cs | 2 -- .../cs/httputility_parsequerystring.cs | 1 - .../CS/ProgrammableValidatorAttribute.cs | 2 -- .../CS/TestingConfigValidatorAttribute.cs | 3 --- .../CS/responsefilter.cs | 2 -- .../CS/bufferedwebeventprovider.cs | 2 -- .../CS/webauditevent.cs | 1 - .../CS/webbaseerrorevent.cs | 1 - .../CS/weberrorevent.cs | 1 - .../CS/webeventprovider.cs | 3 --- .../CS/webprocessstatisticsevent.cs | 1 - .../CS/webrequestinformation.cs | 1 - .../CS/websuccessauditevent.cs | 1 - .../CS/webthreadinformation.cs | 1 - .../CS/WmiWebEventListener.cs | 2 -- .../CS/toolboxdataattribute.cs | 3 --- .../cs/configurationuserlevel.cs | 4 ---- .../CS/WebAuthenticationFailureAuditEvent.cs | 1 - .../CS/WebAuthenticationSuccessAuditEvent.cs | 1 - 81 files changed, 9 insertions(+), 159 deletions(-) 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 d3ed4a33de8..08f7aae70ea 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; @@ -41,5 +40,4 @@ public 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.Sockets/MulticastOption/Overview/listener.cs b/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs index 1dc3c956b35..ade5a8699ac 100644 --- a/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs +++ b/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs @@ -7,7 +7,6 @@ // // - using System; using System.Net; using System.Net.Sockets; @@ -29,10 +28,8 @@ // namespace Mssc.TransportProtocols.Utilities { - public class TestMulticastOption { - private static IPAddress mcastAddress; private static int mcastPort; private static Socket mcastSocket; 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/ComImportAttribute/Overview/codefile5.cs b/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs index 30a5b9b8f8a..74f12af8889 100644 --- a/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs +++ b/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs @@ -1,7 +1,6 @@ // System.Runtime.InteropServices.TypeLibFuncAttribute // System.Runtime.InteropServices.TypeLibFuncFlags // - using System; using System.Reflection; using System.Runtime.InteropServices; 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/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs b/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs index a172454b594..c73512366ff 100644 --- a/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs +++ b/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs @@ -3,7 +3,6 @@ // AsymmetricKeyExchangeFormatter and AsymmetricKeyExchangeDeformatter classes // respectfully and can be found in their class reference. // - using System; using System.Security.Cryptography; 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 678806fbef4..f430b58cb39 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; @@ -84,5 +83,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 60b756bc411..1b07809891f 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 ArrayTypeMisMatchConst diff --git a/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs b/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs index 4a9e6d07b79..70e7f58a10a 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 ArrayTypeMisMatchConst diff --git a/snippets/csharp/System/Type/GetConstructor/type_getconstructor.cs b/snippets/csharp/System/Type/GetConstructor/type_getconstructor.cs index b89197deef3..c7eea835603 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; using System.Security; 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 ded0be8510f..dd0bb19c464 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; diff --git a/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs b/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs index 3340035ae95..d463b165dd0 100644 --- a/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs +++ b/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs @@ -1,6 +1,4 @@ - -// - +// using System; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; diff --git a/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs b/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs index 883e9af1a5c..985841fd181 100644 --- a/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs +++ b/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs @@ -1,6 +1,5 @@ // Snippet for System.ServiceModel.EnvelopeVersion // - using System; using System.Collections.Generic; using System.ServiceModel; diff --git a/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs b/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs index 4306d15945c..5722706f358 100644 --- a/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs +++ b/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs @@ -1,5 +1,4 @@ // - using System; using System.Collections.Generic; using System.ComponentModel; @@ -11,15 +10,12 @@ namespace Samples.AspNet.CS.Controls { - [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class SimpleCustomControl : DetailsView { - protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldProperties fieldProperties) { - // Create an AutoGeneratedField object. AutoGeneratedField field = new AutoGeneratedField(fieldProperties.DataField); @@ -36,5 +32,4 @@ protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldP } } } - // diff --git a/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs b/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs index 767ca914d6b..c31f4005f66 100644 --- a/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs +++ b/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs @@ -1,5 +1,4 @@ // - using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs b/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs index f00b7c0499a..4da5a96b7bd 100644 --- a/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs +++ b/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs @@ -1,5 +1,4 @@ // - using System; using System.IO; using System.Web; @@ -10,7 +9,6 @@ namespace Samples.AspNet.CS { // - // A custom class that overrides its CreateHtmlTextWriter method. // This page uses the HtmlStyledLabelWriter class to render its content. [AspNetHostingPermission(SecurityAction.Demand, diff --git a/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs b/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs index 8c928a161a4..7bf6d7984b9 100644 --- a/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs +++ b/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs @@ -1,5 +1,4 @@ // - using System; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs index 130f8fd9927..fe6b6f47166 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs @@ -2,7 +2,6 @@ // Allowed snippet tags range: [31 - 40]. // - using System; using System.Collections.Generic; using System.Text; @@ -10,7 +9,6 @@ namespace Samples.AspNet { - // Show how to create a custom programmable // validator. That is a validator whose // validation parameters can be passed when the diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs index 0c2af999865..2a9cf12181f 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs @@ -2,7 +2,6 @@ // Allowed snippet tags range: [41 - 50]. // - using System; using System.Collections.Generic; using System.Text; @@ -10,14 +9,12 @@ namespace Samples.AspNet { - class TestingConfigValidatorAttribute { static TestingConfigValidatorAttribute() { try { - SelectCar car; // Get the current configuration file. diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs index 050d547abce..9bd70597ee3 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs @@ -1,12 +1,10 @@ // - using System; using System.IO; using System.Text; namespace Samples.AspNet.CS.Controls { - public class UpperCaseFilterStream : Stream // This filter changes all characters passed through it to uppercase. { diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs index e9dff483e9a..2878dafff5b 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs @@ -3,7 +3,6 @@ *Purpose: Shows how to build a custom event provider. **/ // - using System; using System.Text; using System.IO; @@ -288,5 +287,4 @@ private void StoreToFile(StringBuilder text, // } } - // diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs index 9c03dbf8c1f..efee6ade013 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs @@ -4,7 +4,6 @@ *by inheriting from the System.Web.Management.WebAuditEvent class. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs index cfecefabd79..b255dc5cf3f 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs @@ -4,7 +4,6 @@ *by inheriting from the System.Web.Management.WebBaseErrorEvent class. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs index e0ee0337db8..8346d5ed971 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs @@ -4,7 +4,6 @@ *by inheriting from the System.Web.Management.WebErrorEvent. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs index d6c20dbb929..73f30019aa0 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs @@ -3,7 +3,6 @@ *Purpose: Shows how to build a custom event provider. **/ // - using System; using System.Text; using System.IO; @@ -18,7 +17,6 @@ namespace SamplesAspNet public class SampleEventProvider : System.Web.Management.WebEventProvider { - // The local path of the file where // to store event information. private string logFilePath; @@ -175,5 +173,4 @@ private void StoreToFile(StringBuilder text, // } } - // diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs index f37561d67e6..97ad76c59d8 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs @@ -4,7 +4,6 @@ *to use the System.Web.Management helper classes. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs index 8732f89d8b3..35276589d47 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs @@ -4,7 +4,6 @@ * access the request information. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs index e9294a13358..05513bc476e 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs @@ -4,7 +4,6 @@ *by inheriting from the System.Web.Management.WebSuccessAuditEvent class. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs index 0efd98cf94f..e78febdc088 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs @@ -4,7 +4,6 @@ * access the thread information. **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs index fe04a68f5c0..46b9c1d4e8e 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs @@ -3,7 +3,6 @@ * ASP.NET health monitoriong types. */ // - using System; using System.Management; @@ -145,5 +144,4 @@ static void Main(string[] args) } } } - // diff --git a/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs b/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs index 4a546ae727a..ca120870c5e 100644 --- a/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs +++ b/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs @@ -4,7 +4,6 @@ */ // - using System; using System.Web; using System.Web.UI; @@ -12,7 +11,6 @@ namespace CustomControls { - [ ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow' BackColor='Magenta' BorderWidth = '10' runat='server'>") ] public class MyLabel : Label { @@ -22,5 +20,4 @@ public MyLabel() } } } - // diff --git a/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs b/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs index 4cd73ada8bd..4379bf1dac8 100644 --- a/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs +++ b/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs @@ -1,5 +1,4 @@ // - using System; using System.Collections.Generic; using System.Linq; @@ -12,10 +11,8 @@ public class UsingConsoleConfigElement { - static void GetConfigurationFile() { - try { // Get the current application configuration file. @@ -65,5 +62,4 @@ static void Main(string[] args) Console.ReadLine(); } } - // diff --git a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs index da725c9fc5b..0b0e75fa86b 100644 --- a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs @@ -4,7 +4,6 @@ *by inheriting from the System.Web.Management.WebAuthenticationFailureAuditEvent class **/ // - using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs index 6bfcada9f19..780f2c8077f 100644 --- a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs @@ -4,7 +4,6 @@ *by inheriting from the System.Web.Management.WebAuthenticationSuccessAuditEvent class **/ // - using System; using System.Text; using System.Web; From b4f1d3ab8cf23be635e5ffec6180d13bdba8ce35 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:49:40 +0800 Subject: [PATCH 2/3] Remove some changes --- .../System.Net.Sockets/MulticastOption/Overview/listener.cs | 3 +++ .../ComImportAttribute/Overview/codefile5.cs | 1 + .../Overview/ContosoEncryption.cs | 1 + 3 files changed, 5 insertions(+) diff --git a/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs b/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs index ade5a8699ac..1dc3c956b35 100644 --- a/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs +++ b/snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs @@ -7,6 +7,7 @@ // // + using System; using System.Net; using System.Net.Sockets; @@ -28,8 +29,10 @@ // namespace Mssc.TransportProtocols.Utilities { + public class TestMulticastOption { + private static IPAddress mcastAddress; private static int mcastPort; private static Socket mcastSocket; diff --git a/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs b/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs index 74f12af8889..30a5b9b8f8a 100644 --- a/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs +++ b/snippets/csharp/System.Runtime.InteropServices/ComImportAttribute/Overview/codefile5.cs @@ -1,6 +1,7 @@ // System.Runtime.InteropServices.TypeLibFuncAttribute // System.Runtime.InteropServices.TypeLibFuncFlags // + using System; using System.Reflection; using System.Runtime.InteropServices; diff --git a/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs b/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs index c73512366ff..a172454b594 100644 --- a/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs +++ b/snippets/csharp/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter/Overview/ContosoEncryption.cs @@ -3,6 +3,7 @@ // AsymmetricKeyExchangeFormatter and AsymmetricKeyExchangeDeformatter classes // respectfully and can be found in their class reference. // + using System; using System.Security.Cryptography; From b1ddef7acbc5f3c3a83991e97ef210a49b709b65 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:31:27 +0800 Subject: [PATCH 3/3] Remove CFX and WebNet snippet changes --- snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs | 4 +++- .../csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs | 1 + .../AutoGenerateFieldProperties/CS/SimpleCustomControl.cs | 5 +++++ .../FilterableAttribute_2/CS/simplecustomcontrol.cs | 1 + .../HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs | 2 ++ .../cs/httputility_parsequerystring.cs | 1 + .../CS/ProgrammableValidatorAttribute.cs | 2 ++ .../CS/TestingConfigValidatorAttribute.cs | 3 +++ .../System.Web.HttpRequest_Samples2/CS/responsefilter.cs | 2 ++ .../CS/bufferedwebeventprovider.cs | 2 ++ .../System.Web.Management.WebAuditEvent/CS/webauditevent.cs | 1 + .../CS/webbaseerrorevent.cs | 1 + .../System.Web.Management.WebErrorEvent/CS/weberrorevent.cs | 1 + .../CS/webeventprovider.cs | 3 +++ .../CS/webprocessstatisticsevent.cs | 1 + .../CS/webrequestinformation.cs | 1 + .../CS/websuccessauditevent.cs | 1 + .../CS/webthreadinformation.cs | 1 + .../CS/WmiWebEventListener.cs | 2 ++ .../CS/toolboxdataattribute.cs | 3 +++ .../cs/configurationuserlevel.cs | 4 ++++ .../CS/WebAuthenticationFailureAuditEvent.cs | 1 + .../CS/WebAuthenticationSuccessAuditEvent.cs | 1 + 23 files changed, 43 insertions(+), 1 deletion(-) diff --git a/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs b/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs index d463b165dd0..3340035ae95 100644 --- a/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs +++ b/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs @@ -1,4 +1,6 @@ -// + +// + using System; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; diff --git a/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs b/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs index 985841fd181..883e9af1a5c 100644 --- a/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs +++ b/snippets/csharp/VS_Snippets_CFX/s_ueenvelopeversion/cs/program.cs @@ -1,5 +1,6 @@ // Snippet for System.ServiceModel.EnvelopeVersion // + using System; using System.Collections.Generic; using System.ServiceModel; diff --git a/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs b/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs index 5722706f358..4306d15945c 100644 --- a/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs +++ b/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs @@ -1,4 +1,5 @@ // + using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,12 +11,15 @@ namespace Samples.AspNet.CS.Controls { + [AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class SimpleCustomControl : DetailsView { + protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldProperties fieldProperties) { + // Create an AutoGeneratedField object. AutoGeneratedField field = new AutoGeneratedField(fieldProperties.DataField); @@ -32,4 +36,5 @@ protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldP } } } + // diff --git a/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs b/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs index c31f4005f66..767ca914d6b 100644 --- a/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs +++ b/snippets/csharp/VS_Snippets_WebNet/FilterableAttribute_2/CS/simplecustomcontrol.cs @@ -1,4 +1,5 @@ // + using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs b/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs index 4da5a96b7bd..f00b7c0499a 100644 --- a/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs +++ b/snippets/csharp/VS_Snippets_WebNet/HtmlTextWriter_Methods3/CS/htmltextwriter_methods3.cs @@ -1,4 +1,5 @@ // + using System; using System.IO; using System.Web; @@ -9,6 +10,7 @@ namespace Samples.AspNet.CS { // + // A custom class that overrides its CreateHtmlTextWriter method. // This page uses the HtmlStyledLabelWriter class to render its content. [AspNetHostingPermission(SecurityAction.Demand, diff --git a/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs b/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs index 7bf6d7984b9..8c928a161a4 100644 --- a/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs +++ b/snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs @@ -1,4 +1,5 @@ // + using System; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs index fe6b6f47166..130f8fd9927 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/ProgrammableValidatorAttribute.cs @@ -2,6 +2,7 @@ // Allowed snippet tags range: [31 - 40]. // + using System; using System.Collections.Generic; using System.Text; @@ -9,6 +10,7 @@ namespace Samples.AspNet { + // Show how to create a custom programmable // validator. That is a validator whose // validation parameters can be passed when the diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs index 2a9cf12181f..0c2af999865 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigValidatorAttribute/CS/TestingConfigValidatorAttribute.cs @@ -2,6 +2,7 @@ // Allowed snippet tags range: [41 - 50]. // + using System; using System.Collections.Generic; using System.Text; @@ -9,12 +10,14 @@ namespace Samples.AspNet { + class TestingConfigValidatorAttribute { static TestingConfigValidatorAttribute() { try { + SelectCar car; // Get the current configuration file. diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs index 9bd70597ee3..050d547abce 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/responsefilter.cs @@ -1,10 +1,12 @@ // + using System; using System.IO; using System.Text; namespace Samples.AspNet.CS.Controls { + public class UpperCaseFilterStream : Stream // This filter changes all characters passed through it to uppercase. { diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs index 2878dafff5b..e9dff483e9a 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.BufferedWebEventProvider/CS/bufferedwebeventprovider.cs @@ -3,6 +3,7 @@ *Purpose: Shows how to build a custom event provider. **/ // + using System; using System.Text; using System.IO; @@ -287,4 +288,5 @@ private void StoreToFile(StringBuilder text, // } } + // diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs index efee6ade013..9c03dbf8c1f 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebAuditEvent/CS/webauditevent.cs @@ -4,6 +4,7 @@ *by inheriting from the System.Web.Management.WebAuditEvent class. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs index b255dc5cf3f..cfecefabd79 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebBaseErrorEvent/CS/webbaseerrorevent.cs @@ -4,6 +4,7 @@ *by inheriting from the System.Web.Management.WebBaseErrorEvent class. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs index 8346d5ed971..e0ee0337db8 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebErrorEvent/CS/weberrorevent.cs @@ -4,6 +4,7 @@ *by inheriting from the System.Web.Management.WebErrorEvent. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs index 73f30019aa0..d6c20dbb929 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebEventProvider/CS/webeventprovider.cs @@ -3,6 +3,7 @@ *Purpose: Shows how to build a custom event provider. **/ // + using System; using System.Text; using System.IO; @@ -17,6 +18,7 @@ namespace SamplesAspNet public class SampleEventProvider : System.Web.Management.WebEventProvider { + // The local path of the file where // to store event information. private string logFilePath; @@ -173,4 +175,5 @@ private void StoreToFile(StringBuilder text, // } } + // diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs index 97ad76c59d8..f37561d67e6 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebProcessStatistics/CS/webprocessstatisticsevent.cs @@ -4,6 +4,7 @@ *to use the System.Web.Management helper classes. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs index 35276589d47..8732f89d8b3 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebRequestInformation/CS/webrequestinformation.cs @@ -4,6 +4,7 @@ * access the request information. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs index 05513bc476e..e9294a13358 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebSuccessAuditEvent/CS/websuccessauditevent.cs @@ -4,6 +4,7 @@ *by inheriting from the System.Web.Management.WebSuccessAuditEvent class. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs index e78febdc088..0efd98cf94f 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WebThreadInformation/CS/webthreadinformation.cs @@ -4,6 +4,7 @@ * access the thread information. **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs index 46b9c1d4e8e..fe04a68f5c0 100644 --- a/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs +++ b/snippets/csharp/VS_Snippets_WebNet/System.Web.Management.WmiWebEventProvider/CS/WmiWebEventListener.cs @@ -3,6 +3,7 @@ * ASP.NET health monitoriong types. */ // + using System; using System.Management; @@ -144,4 +145,5 @@ static void Main(string[] args) } } } + // diff --git a/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs b/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs index ca120870c5e..4a546ae727a 100644 --- a/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs +++ b/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_ToolboxDataAttribute/CS/toolboxdataattribute.cs @@ -4,6 +4,7 @@ */ // + using System; using System.Web; using System.Web.UI; @@ -11,6 +12,7 @@ namespace CustomControls { + [ ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow' BackColor='Magenta' BorderWidth = '10' runat='server'>") ] public class MyLabel : Label { @@ -20,4 +22,5 @@ public MyLabel() } } } + // diff --git a/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs b/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs index 4379bf1dac8..4cd73ada8bd 100644 --- a/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs +++ b/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs @@ -1,4 +1,5 @@ // + using System; using System.Collections.Generic; using System.Linq; @@ -11,8 +12,10 @@ public class UsingConsoleConfigElement { + static void GetConfigurationFile() { + try { // Get the current application configuration file. @@ -62,4 +65,5 @@ static void Main(string[] args) Console.ReadLine(); } } + // diff --git a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs index 0b0e75fa86b..da725c9fc5b 100644 --- a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationFailureAuditEvent/CS/WebAuthenticationFailureAuditEvent.cs @@ -4,6 +4,7 @@ *by inheriting from the System.Web.Management.WebAuthenticationFailureAuditEvent class **/ // + using System; using System.Text; using System.Web; diff --git a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs index 780f2c8077f..6bfcada9f19 100644 --- a/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs +++ b/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs @@ -4,6 +4,7 @@ *by inheriting from the System.Web.Management.WebAuthenticationSuccessAuditEvent class **/ // + using System; using System.Text; using System.Web;