diff --git a/snippets/csharp/System.Diagnostics/ProcessStartInfo/Verb/source.cs b/snippets/csharp/System.Diagnostics/ProcessStartInfo/Verb/source.cs index 4b6b2123da0..251f200293e 100644 --- a/snippets/csharp/System.Diagnostics/ProcessStartInfo/Verb/source.cs +++ b/snippets/csharp/System.Diagnostics/ProcessStartInfo/Verb/source.cs @@ -1,5 +1,4 @@ // -// using System; using System.ComponentModel; using System.IO; @@ -49,14 +48,13 @@ static void Main() startInfo.Verb = verbToUse; if (verbToUse.ToLower().IndexOf("printto") >= 0) { - // printto implies a specific printer. Ask for the network address. + // printto implies a specific printer. Ask for the network address. // The address must be in the form \\server\printer. // The printer address is passed as the Arguments property. Console.Write("Enter the network address of the target printer: "); var arguments = Console.ReadLine(); startInfo.Arguments = arguments; } - // try { @@ -81,6 +79,7 @@ static void Main() Console.WriteLine($"Unable to start '{fileName}' with verb {verbToUse}"); } } + // } else { @@ -90,5 +89,4 @@ static void Main() } } } -// // diff --git a/xml/Microsoft.CSharp/CSharpCodeProvider.xml b/xml/Microsoft.CSharp/CSharpCodeProvider.xml index 1eb58ea98ee..15cc64b5be6 100644 --- a/xml/Microsoft.CSharp/CSharpCodeProvider.xml +++ b/xml/Microsoft.CSharp/CSharpCodeProvider.xml @@ -32,22 +32,24 @@ Provides access to instances of the C# code generator and code compiler. - and implementations. - + and implementations. + > [!NOTE] -> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. - - - -## Examples - The following example uses either the C# or Visual Basic code provider to compile a source file. The example checks the input file extension and uses the corresponding or for compilation. The input file is compiled into an executable file, and any compilation errors are displayed to the console. - +> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. + +## Examples + The following example uses either the C# or Visual Basic code provider to compile a source file. The example checks the input file extension and uses the corresponding or for compilation. The input file is compiled into an executable file, and any compilation errors are displayed to the console. + +> [!IMPORTANT] +> The `CompileAssemblyFrom*` methods aren't supported on .NET Core and .NET 5+. This example only runs on .NET Framework. + :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CodeProviders/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CodeProviders/VB/source.vb" id="Snippet1"::: + ]]> @@ -124,40 +126,40 @@ A object that contains the provider options. Initializes a new instance of the class by using the specified provider options. - ](/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element) element in the configuration file. You can identify the version of the you want to use by specifying the `` element, supplying "CompilerVersion" as the option name, and supplying the version number (for example, "v3.5") as the option value. You must precede the version number with a lower case "v". The following configuration file example demonstrates how to specify that version 3.5 of the C# code provider should be used. - -```xml - - - - - - - - - - -``` +In .NET Framework apps, you can obtain the value for `providerOptions` from the [\](/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element) element in the configuration file. You can identify the version of the you want to use by specifying the `` element, supplying "CompilerVersion" as the option name, and supplying the version number (for example, "v3.5") as the option value. You must precede the version number with a lower case "v". The following configuration file example demonstrates how to specify that version 3.5 of the C# code provider should be used. + +```xml + + + + + + + + + + +``` ## Examples - The following example shows how to specify the compiler version when you create a new instance of the class. - - :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/.ctor/program.cs" id="Snippet1"::: - + The following example shows how to specify the compiler version when you create a new instance of the class. + + :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/.ctor/program.cs" id="Snippet1"::: + ]]> @@ -291,11 +293,11 @@ In .NET Framework apps, you can obtain the value for `providerOptions` from the Gets the file name extension to use when creating source code files. The file name extension to use for generated source code files. - @@ -337,19 +339,19 @@ In .NET Framework apps, you can obtain the value for `providerOptions` from the The to use when generating the code. Generates code for the specified class member using the specified text writer and code generator options. - method to create a code fragment to be used in a CodeDOM graph. This code example is part of a larger example provided for the method of the class. - + method to create a code fragment to be used in a CodeDOM graph. This code example is part of a larger example provided for the method of the class. + :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_GenerateCodeFromMember/vb/module1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_GenerateCodeFromMember/vb/module1.vb" id="Snippet3"::: + ]]> @@ -392,11 +394,11 @@ In .NET Framework apps, you can obtain the value for `providerOptions` from the Gets a for the specified type of object. A for the specified type. - diff --git a/xml/Microsoft.Extensions.Caching.Memory/MemoryCacheOptions.xml b/xml/Microsoft.Extensions.Caching.Memory/MemoryCacheOptions.xml index 49f21066301..e99fc147659 100644 --- a/xml/Microsoft.Extensions.Caching.Memory/MemoryCacheOptions.xml +++ b/xml/Microsoft.Extensions.Caching.Memory/MemoryCacheOptions.xml @@ -210,9 +210,9 @@ Gets or sets the maximum size of the cache. To be added. - [!CAUTION] -> There may be transient states while the cache is full but blocks are being released on a background thread. In this state, unexpected behavior might occur if the cache is being overutilized. + [!CAUTION] +> There might be transient states while the cache is full but blocks are being released on a background thread. In this state, unexpected behavior might occur if the cache is being overutilized. ]]> @@ -238,12 +238,12 @@ if linked entries are tracked; otherwise, . The default is in .NET 7 and later versions. - diff --git a/xml/System.CodeDom.Compiler/CodeDomProvider.xml b/xml/System.CodeDom.Compiler/CodeDomProvider.xml index aad6663a6d1..f3fc7f66d2a 100644 --- a/xml/System.CodeDom.Compiler/CodeDomProvider.xml +++ b/xml/System.CodeDom.Compiler/CodeDomProvider.xml @@ -43,34 +43,34 @@ Provides a base class for implementations. This class is abstract. - can be used to create and retrieve instances of code generators and code compilers. Code generators can be used to generate code in a particular language, and code compilers can be used to compile code into assemblies. - + can be used to create and retrieve instances of code generators and code compilers. Code generators can be used to generate code in a particular language, and code compilers can be used to compile code into assemblies. + > [!NOTE] -> In the .NET Framework 2.0, the methods made available in the code generator and code compiler are available directly from the code provider. You do not need to call or to access the methods, and those methods are marked as obsolete. This applies to preexisting as well as new code provider implementations. - - A implementation typically provides code generation and/or code compilation interfaces for generating code and managing compilation for a single programming language. Several languages are supported by implementations that ship with the Windows SDK. These languages include C#, Visual Basic, C++, and JScript. Developers or compiler vendors can implement the and interfaces and provide a that extends CodeDOM support to other programming languages. - - The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) provides a mechanism for developers and compiler vendors to add configuration settings for additional implementations. - - The class provides static methods to discover and enumerate the implementations on a computer. The method returns the settings for all implementations on a computer. The method returns the settings for a specific implementation, based on the programming language name. The method returns an instance of a implementation for a specific language. - - For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/). - +> In the .NET Framework 2.0, the methods made available in the code generator and code compiler are available directly from the code provider. You do not need to call or to access the methods, and those methods are marked as obsolete. This applies to preexisting as well as new code provider implementations. + + A implementation typically provides code generation and/or code compilation interfaces for generating code and managing compilation for a single programming language. Several languages are supported by implementations that ship with the Windows SDK. These languages include C#, Visual Basic, C++, and JScript. Developers or compiler vendors can implement the and interfaces and provide a that extends CodeDOM support to other programming languages. + + The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) provides a mechanism for developers and compiler vendors to add configuration settings for additional implementations. + + The class provides static methods to discover and enumerate the implementations on a computer. The method returns the settings for all implementations on a computer. The method returns the settings for a specific implementation, based on the programming language name. The method returns an instance of a implementation for a specific language. + + For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/). + > [!NOTE] -> This class makes a link demand and an inheritance demand at the class level. A is thrown if either the immediate caller or the derived class does not have full trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). - - - -## Examples - The following example program can generate and compile source code based on a CodeDOM model of a program that prints "Hello World" using the class. A Windows Forms user interface is provided. The user can select the target programming language from several selections: C#, Visual Basic, and JScript. - +> This class makes a link demand and an inheritance demand at the class level. A is thrown if either the immediate caller or the derived class does not have full trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). + + + +## Examples + The following example program can generate and compile source code based on a CodeDOM model of a program that prints "Hello World" using the class. A Windows Forms user interface is provided. The user can select the target programming language from several selections: C#, Visual Basic, and JScript. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet1"::: + ]]> @@ -161,16 +161,16 @@ Compiles an assembly based on the trees contained in the specified array of objects, using the specified compiler settings. A object that indicates the results of the compilation. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + [!NOTE] +## Remarks + +> [!IMPORTANT] > On .NET Core and .NET 5+, calls to the `CodeDomProvider.CompileAssemblyFromDom` method throw a . Compile code is not supported. - + +> [!NOTE] +> In .NET Framework 2.0 and later versions, this method can be called directly on the code provider even if it's not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -226,16 +226,16 @@ Compiles an assembly from the source code contained in the specified files, using the specified compiler settings. A object that indicates the results of compilation. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + [!NOTE] +## Remarks + +> [!IMPORTANT] > On .NET Core and .NET 5+, calls to the `CodeDomProvider.CompileAssemblyFromFile` method throw a . Compile from file is not supported. +> [!NOTE] +> In .NET Framework 2.0 and later versions, this method can be called directly on the code provider even if it's not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -290,16 +290,16 @@ Compiles an assembly from the specified array of strings containing source code, using the specified compiler settings. A object that indicates the results of compilation. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + [!NOTE] +## Remarks + +> [!IMPORTANT] > On .NET Core and .NET 5+, calls to the `CodeDomProvider.CompileAssemblyFromSource` method throw a . Compile source code is not supported. +> [!NOTE] +> In .NET Framework 2.0 and later versions, this method can be called directly on the code provider even if it's not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -353,11 +353,11 @@ When overridden in a derived class, creates a new code compiler. An that can be used for compilation of based source code representations. - methods that are directly available in the code provider. - + methods that are directly available in the code provider. + ]]> @@ -399,14 +399,14 @@ Creates an escaped identifier for the specified value. The escaped identifier for the value. - tests whether the identifier conflicts with any reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier contains the same `value` but has escape-code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the `value` with "@" or bracketing the `value` with "[" and "]". - + tests whether the identifier conflicts with any reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier contains the same `value` but has escape-code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the `value` with "@" or bracketing the `value` with "[" and "]". + > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -466,11 +466,11 @@ When overridden in a derived class, creates a new code generator. An that can be used to generate based source code representations. - methods that are directly available in the class. - + methods that are directly available in the class. + ]]> @@ -519,14 +519,14 @@ When overridden in a derived class, creates a new code generator using the specified for output. An that can be used to generate based source code representations. - for output. This method supports more optimized code generation that incrementally updates the source code. - + for output. This method supports more optimized code generation that incrementally updates the source code. + > [!NOTE] -> The base class implementation calls the method, which is obsolete in the .NET Framework 2.0 and results in a if an object is not returned. - +> The base class implementation calls the method, which is obsolete in the .NET Framework 2.0 and results in a if an object is not returned. + ]]> @@ -573,14 +573,14 @@ When overridden in a derived class, creates a new code generator using the specified file name for output. An that can be used to generate based source code representations. - [!NOTE] -> The base class implementation calls the method, which is obsolete in the .NET Framework 2.0 and results in a if an object is not returned. - +> The base class implementation calls the method, which is obsolete in the .NET Framework 2.0 and results in a if an object is not returned. + ]]> @@ -678,36 +678,36 @@ Gets a instance for the specified language. A CodeDOM provider that is implemented for the specified language name. - [!NOTE] -> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. allows you to specify at run time the code provider you wish to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider rather than use the method. - - The method returns a instance for a specific language name; it is similar to calling the method with the language provider type. Use when you want to dynamically find a configured provider implementation for a language name. - - If more than one provider implementation is configured for the language name, returns a provider instance for the last matching configuration element. - - Use the method overload when you want a specific language provider implementation. For example, use the method to get a provider instance that supports the language name `"CSharp"`; use the method overload to get a provider instance specifically for the implementation. Use the method if you have multiple code providers for a language and you desire to instantiate a specific code provider. - - The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . If you pass an unsupported language name to a is thrown. - - The method can be used to determine all implementations on a computer, including additional implementations provided by developers and compiler vendors that are identified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config). - - The method returns an instance of a implementation for a specific language. - - Language names are case-insensitive. - - - -## Examples - The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. - +> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. allows you to specify at run time the code provider you wish to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider rather than use the method. + + The method returns a instance for a specific language name; it is similar to calling the method with the language provider type. Use when you want to dynamically find a configured provider implementation for a language name. + + If more than one provider implementation is configured for the language name, returns a provider instance for the last matching configuration element. + + Use the method overload when you want a specific language provider implementation. For example, use the method to get a provider instance that supports the language name `"CSharp"`; use the method overload to get a provider instance specifically for the implementation. Use the method if you have multiple code providers for a language and you desire to instantiate a specific code provider. + + The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . If you pass an unsupported language name to a is thrown. + + The method can be used to determine all implementations on a computer, including additional implementations provided by developers and compiler vendors that are identified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config). + + The method returns an instance of a implementation for a specific language. + + Language names are case-insensitive. + + + +## Examples + The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6"::: + ]]> The does not have a configured provider on this computer. @@ -757,25 +757,25 @@ Gets a instance for the specified language and provider options. A CodeDOM provider that is implemented for the specified language name and options. - [!NOTE] -> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. enables you to specify at run time the version of the code provider you want to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider instead of using the method. - - Use when you want to dynamically find a configured provider implementation for a specific language and options. Language names are case-insensitive. For information about supported provider options, see the specific CodeDOM provider documentation. - - For information about validating a provider and calling a provider if more than one provider implementation is configured for the language name, see the Remarks section of the method. - - - -## Examples - The following example shows how to create an instance of a provider by using the `providerOptions` parameter. - +> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. enables you to specify at run time the version of the code provider you want to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider instead of using the method. + + Use when you want to dynamically find a configured provider implementation for a specific language and options. Language names are case-insensitive. For information about supported provider options, see the specific CodeDOM provider documentation. + + For information about validating a provider and calling a provider if more than one provider implementation is configured for the language name, see the Remarks section of the method. + + + +## Examples + The following example shows how to create an instance of a provider by using the `providerOptions` parameter. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/program.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/codedomprovider.provideroptions/vb/program.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/codedomprovider.provideroptions/vb/program.vb" id="Snippet1"::: + ]]> @@ -814,14 +814,14 @@ Creates a valid identifier for the specified value. A valid identifier for the specified value. - tests whether the identifier conflicts with reserved or language keywords, and if so, attempts to return a valid identifier name that does not conflict. Usually the returned identifier is only slightly modified to differentiate the identifier from the keyword; for example, the name might be preceded by the underscore ("_") character. - + tests whether the identifier conflicts with reserved or language keywords, and if so, attempts to return a valid identifier name that does not conflict. Usually the returned identifier is only slightly modified to differentiate the identifier from the keyword; for example, the name might be preceded by the underscore ("_") character. + > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -867,20 +867,20 @@ Gets the default file name extension to use for source code files in the current language. A file name extension corresponding to the extension of the source files of the current language. The base implementation always returns . - . The example displays the provider name, hash code and default file name extension for the new provider instance. - + . The example displays the provider name, hash code and default file name extension for the new provider instance. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet3"::: + ]]> @@ -922,22 +922,22 @@ A that indicates the options to use for generating code. Generates code for the specified Code Document Object Model (CodeDOM) compilation unit and sends it to the specified text writer, using the specified options. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - - - -## Examples - The following code example shows the use of the method to generate code for a "Hello World" application from a . This example is part of a larger example provided for the class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + + + +## Examples + The following code example shows the use of the method to generate code for a "Hello World" application from a . This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet3"::: + ]]> Neither this method nor the method is overridden in a derived class. @@ -986,13 +986,13 @@ A that indicates the options to use for generating code. Generates code for the specified Code Document Object Model (CodeDOM) expression and sends it to the specified text writer, using the specified options. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -1041,19 +1041,19 @@ A that indicates the options to use for generating code. Generates code for the specified Code Document Object Model (CodeDOM) member declaration and sends it to the specified text writer, using the specified options. - . See for documentation describing an implementation of this method. - - - -## Examples - The following code example shows the use of the method as implemented by the and classes. - + . See for documentation describing an implementation of this method. + + + +## Examples + The following code example shows the use of the method as implemented by the and classes. + :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_GenerateCodeFromMember/vb/module1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_GenerateCodeFromMember/vb/module1.vb" id="Snippet1"::: + ]]> This method is not overridden in a derived class. @@ -1099,13 +1099,13 @@ A that indicates the options to use for generating code. Generates code for the specified Code Document Object Model (CodeDOM) namespace and sends it to the specified text writer, using the specified options. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -1154,13 +1154,13 @@ A that indicates the options to use for generating code. Generates code for the specified Code Document Object Model (CodeDOM) statement and sends it to the specified text writer, using the specified options. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -1209,13 +1209,13 @@ A that indicates the options to use for generating code. Generates code for the specified Code Document Object Model (CodeDOM) type declaration and sends it to the specified text writer, using the specified options. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -1264,23 +1264,23 @@ Returns the language provider and compiler configuration settings for this computer. An array of type representing the settings of all configured implementations. - method to enumerate the language provider settings on a computer. - + method to enumerate the language provider settings on a computer. + > [!NOTE] -> In the .NET Framework 2.0, the default language providers supplied by the .NET Framework are not specified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) compiler configuration section and cannot be removed, so this method returns information about the default providers and any specified in the configuration file. - - - -## Examples - The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class. - +> In the .NET Framework 2.0, the default language providers supplied by the .NET Framework are not specified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) compiler configuration section and cannot be removed, so this method returns information about the default providers and any specified in the configuration file. + + + +## Examples + The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8"::: + ]]> The caller does not have the required permission. @@ -1328,26 +1328,26 @@ Returns the language provider and compiler configuration settings for the specified language. A object populated with settings of the configured implementation. - implementation on the computer. For information about machine configuration files, see the Machine Configuration Files section in [Configuring Apps](/dotnet/framework/configure-apps/). The method searches each provider configuration element for the specified language name. The returned instance contains the configured language provider and compiler settings. - - The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . This prevents throwing a when you access the instance for an unsupported language name. - - If more than one provider implementation is configured for the input language name, returns the settings from the last matching provider configuration element. - - Language names are case-insensitive. - - - -## Examples - The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. - + implementation on the computer. For information about machine configuration files, see the Machine Configuration Files section in [Configuring Apps](/dotnet/framework/configure-apps/). The method searches each provider configuration element for the specified language name. The returned instance contains the configured language provider and compiler settings. + + The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . This prevents throwing a when you access the instance for an unsupported language name. + + If more than one provider implementation is configured for the input language name, returns the settings from the last matching provider configuration element. + + Language names are case-insensitive. + + + +## Examples + The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6"::: + ]]> The does not have a configured provider on this computer. @@ -1393,11 +1393,11 @@ Gets a for the specified data type. A for the specified type, or if a for the specified type cannot be found. - @@ -1443,26 +1443,26 @@ Returns a language name associated with the specified file name extension, as configured in the compiler configuration section. A language name associated with the file name extension, as configured in the compiler configuration settings. - implementation on the computer. The method searches each provider configuration element for the specified file name extension. - - The method checks whether at least one provider implementation supports a specific file name extension. You can validate a file name extension using before passing it to . This prevents from throwing a for an unsupported file name extension. - - If a provider implementation supports the input file name extension, and there are multiple supported languages configured for that provider, then returns the first language name for that provider. If more than one provider implementation is configured for the input file name extension, returns the language name from the last matching provider configuration element. - - Language names and file name extensions are case-insensitive. - - - -## Examples - The following code example determines the implementation for an input file name extension and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. - + implementation on the computer. The method searches each provider configuration element for the specified file name extension. + + The method checks whether at least one provider implementation supports a specific file name extension. You can validate a file name extension using before passing it to . This prevents from throwing a for an unsupported file name extension. + + If a provider implementation supports the input file name extension, and there are multiple supported languages configured for that provider, then returns the first language name for that provider. If more than one provider implementation is configured for the input file name extension, returns the language name from the last matching provider configuration element. + + Language names and file name extensions are case-insensitive. + + + +## Examples + The following code example determines the implementation for an input file name extension and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet5"::: + ]]> The does not have a configured language provider on this computer. @@ -1507,13 +1507,13 @@ Gets the type indicated by the specified . A text representation of the specified type, formatted for the language in which code is generated by this code generator. In Visual Basic, for example, passing in a for the type will return "Integer". - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -1563,22 +1563,22 @@ if a implementation is configured for the specified file name extension; otherwise, . - implementation on the computer. The method searches the provider configuration elements for the specified file name extension. - - File name extensions are case-insensitive. - - - -## Examples - The following code example determines the implementation for an input file name extension and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. - + implementation on the computer. The method searches the provider configuration elements for the specified file name extension. + + File name extensions are case-insensitive. + + + +## Examples + The following code example determines the implementation for an input file name extension and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet5"::: + ]]> The is . @@ -1629,22 +1629,22 @@ if a implementation is configured for the specified language; otherwise, . - implementation on the computer. The method searches the provider configuration elements for the specified language name. - - Language names are case-insensitive. - - - -## Examples - The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. - + implementation on the computer. The method searches the provider configuration elements for the specified language name. + + Language names are case-insensitive. + + + +## Examples + The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6"::: + ]]> The is . @@ -1688,20 +1688,20 @@ if the parameter is a valid identifier; otherwise, . - method is provider specific. Identifiers that are valid for one provider might not be valid for other providers. If `value` contains characters outside of the ASCII character range, check the identifier for all the languages that might be used to compile the code. - + method is provider specific. Identifiers that are valid for one provider might not be valid for other providers. If `value` contains characters outside of the ASCII character range, check the identifier for all the languages that might be used to compile the code. + > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. - When overriding in a derived class, design the method to return only if the value fits the rules of the language and does not conflict with a keyword. - + When overriding in a derived class, design the method to return only if the value fits the rules of the language and does not conflict with a keyword. + If you override this method, you must not call the corresponding method of the base class. The base-class method creates a generator in the derived class using the obsolete method for compatibility with preexisting providers that use code generators. The base-class method then calls the equivalent method in the implementation to perform this function. You will get a if you call the base-class method from a code provider that does not use a code generator. @@ -1773,13 +1773,13 @@ Compiles the code read from the specified text stream into a . A that contains a representation of the parsed code. - [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. @@ -1825,14 +1825,14 @@ if the specified code generation support is provided; otherwise, . - flags at once to test for a set of capabilities by joining a set of appropriate capability flags together with a binary `OR` operator (|). - + flags at once to test for a set of capabilities by joining a set of appropriate capability flags together with a binary `OR` operator (|). + > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. - +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. + ]]> Neither this method nor the method is overridden in a derived class. diff --git a/xml/System.Collections/ArrayList.xml b/xml/System.Collections/ArrayList.xml index a74f71694e2..f4ba76463e6 100644 --- a/xml/System.Collections/ArrayList.xml +++ b/xml/System.Collections/ArrayList.xml @@ -115,19 +115,19 @@ ## Remarks > [!IMPORTANT] -> We don't recommend that you use the `ArrayList` class for new development. Instead, we recommend that you use the generic class. +> We don't recommend that you use the `ArrayList` class for new development. Instead, we recommend that you use the generic class. > The class is designed to hold heterogeneous collections of objects. However, it does not always offer the best performance. Instead, we recommend the following: > - For a heterogeneous collection of objects, use the `List` (in C#) or `List(Of Object)` (in Visual Basic) type. > - For a homogeneous collection of objects, use the class. -> See [Performance Considerations](xref:System.Collections.Generic.List%601#performance-considerations) in the reference topic for a discussion of the relative performance of these classes. See [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub for general information on the use of generic instead of non-generic collection types. +> See [Performance Considerations](xref:System.Collections.Generic.List%601#performance-considerations) in the reference topic for a discussion of the relative performance of these classes. See [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub for general information on the use of generic instead of non-generic collection types. - The is not guaranteed to be sorted. You must sort the by calling its method prior to performing operations (such as ) that require the to be sorted. To maintain a collection that is automatically sorted as new elements are added, you can use the class. + The is not guaranteed to be sorted. You must sort the by calling its method prior to performing operations (such as ) that require the to be sorted. To maintain a collection that is automatically sorted as new elements are added, you can use the class. The capacity of an is the number of elements the can hold. As elements are added to an , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling or by setting the property explicitly. **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. - Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based. + Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based. The collection accepts `null` as a valid value. It also allows duplicate elements. @@ -684,8 +684,6 @@ This method is an `O(1)` operation. This method is an `O(log n)` operation, where `n` is . - - ## Examples The following code example shows how to use to locate a specific object in the . @@ -781,8 +779,6 @@ This method is an `O(1)` operation. This method is an `O(log n)` operation, where `n` is . - - ## Examples The following example creates an of colored animals. The provided performs the string comparison for the binary search. The results of both an iterative search and a binary search are displayed. @@ -1023,7 +1019,7 @@ This method is an `O(1)` operation. ## Remarks is set to zero, and references to other objects from elements of the collection are also released. - remains unchanged. To reset the capacity of the , call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. + remains unchanged. To reset the capacity of the , call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. This method is an `O(n)` operation, where `n` is . @@ -1749,11 +1745,11 @@ This method is an `O(1)` operation. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . returns the same object until either or is called. sets to the next element. @@ -1761,7 +1757,7 @@ This method is an `O(1)` operation. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. - The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. + The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. This method is an `O(1)` operation. @@ -1839,11 +1835,11 @@ This method is an `O(1)` operation. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . returns the same object until either or is called. sets to the next element. @@ -1851,7 +1847,7 @@ This method is an `O(1)` operation. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. - The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. + The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. This method is an `O(1)` operation. diff --git a/xml/System.Diagnostics/Process.xml b/xml/System.Diagnostics/Process.xml index 7000af75d69..228cdfc9b5a 100644 --- a/xml/System.Diagnostics/Process.xml +++ b/xml/System.Diagnostics/Process.xml @@ -2660,16 +2660,19 @@ The calling process is a member of the associated process's descendant tree. Gets the main module for the associated process. - The that was used to start the process. + The that was used to start the process, or if no main module was found. property lets you view information about the executable used to start the process, including the module name, file name, and module memory details. + +A process module represents a .dll or .exe file that's loaded into a particular process. The property lets you view information about the executable used to start the process, including the module name, file name, and module memory details. + +If no main module is found, it could be because the process hasn't finished loading the main module when the property is called. ]]> - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. + You are trying to access the property for a process that's running on a remote computer. This property is available only for processes that are running on the local computer. A 32-bit process is trying to access the modules of a 64-bit process. The process is not available. diff --git a/xml/System.Diagnostics/ProcessStartInfo.xml b/xml/System.Diagnostics/ProcessStartInfo.xml index 009f1024c14..bb27c0f58e6 100644 --- a/xml/System.Diagnostics/ProcessStartInfo.xml +++ b/xml/System.Diagnostics/ProcessStartInfo.xml @@ -1958,11 +1958,10 @@ You can use asynchronous read operations to avoid these dependencies and their d property. For example, the "`print`" verb will print a document specified by using . The default verb can be specified by using an empty string (""). Examples of verbs are "Edit", "Open", "OpenAsReadOnly", "Print", and "Printto". You should use only verbs that appear in the set of verbs returned by the property. - - When you use the property, you must include the file name extension when you set the value of the property. The file name does not need to have an extension if you manually enter a value for the property. +Each file name extension has its own set of verbs, which can be obtained by using the property. For example, the "`print`" verb prints a document specified by using . The default verb can be specified by using an empty string (""). Examples of verbs are "Edit", "Open", "OpenAsReadOnly", "Print", and "Printto". You should use only verbs that appear in the set of verbs returned by the property. +When you use the property, you must include the file name extension when you set the value of the property. The file name does not need to have an extension if you manually enter a value for the property. ## Examples The following code example starts a new process by using the specified verb and file name. This code example is part of a larger example provided for the property. @@ -2032,12 +2031,10 @@ You can use asynchronous read operations to avoid these dependencies and their d When you use the property, you must include the file name extension when you set the value of the property. The file name extension determines the set of possible verbs. - - ## Examples The following code example displays the defined verbs for the chosen file name. If the user selects one of the defined verbs, the example starts a new process using the selected verb and the input file name. - :::code language="csharp" source="~/snippets/csharp/System.Diagnostics/ProcessStartInfo/Verb/source.cs" id="Snippet3"::: + :::code language="csharp" source="~/snippets/csharp/System.Diagnostics/ProcessStartInfo/Verb/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/ProcessVerbs_Diagnostics/VB/source.vb" id="Snippet3"::: ]]> diff --git a/xml/System.Drawing/Size.xml b/xml/System.Drawing/Size.xml index 6f2c2930f01..47474808492 100644 --- a/xml/System.Drawing/Size.xml +++ b/xml/System.Drawing/Size.xml @@ -77,11 +77,12 @@ Stores an ordered pair of integers, which specify a and . - class is used to specify a height and width through the property for , , , and other graphics classes. You can perform operations on a by using the overloaded operators such as , , and . The unit for the and of the structure depend on the and settings for the object that is used to draw. - + structure is used to specify a height and width through the property for , , , and other graphics classes. You can perform operations on a by using the overloaded operators such as , , and . The unit for the and of the structure depend on the and settings for the object that is used to draw. + ]]> @@ -188,15 +189,15 @@ The height component of the new . Initializes a new instance of the structure from the specified dimensions. - and constructors and the enumeration. To run this example, paste this code into a Windows Form that contains a label named `Label1` and call the `InitializeLabel1` method in the form's constructor. - + and constructors and the enumeration. To run this example, paste this code into a Windows Form that contains a label named `Label1` and call the `InitializeLabel1` method in the form's constructor. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet7"::: + ]]> @@ -247,14 +248,14 @@ Adds the width and height of one structure to the width and height of another structure. A structure that is the result of the addition operation. - method. To run this example, paste it into a Windows Form. Handle the form's event and call the `AddSizes` method from the event-handling method, passing `e` as . - + method. To run this example, paste it into a Windows Form. Handle the form's event and call the `AddSizes` method from the event-handling method, passing `e` as . + :::code language="csharp" source="~/snippets/csharp/System.Drawing/CharacterRange/Equals/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.MiscWhidbeySnippets/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.MiscWhidbeySnippets/VB/Form1.vb" id="Snippet11"::: + ]]> @@ -514,11 +515,11 @@ Returns a hash code for this structure. An integer value that specifies a hash value for this structure. - for unique values, as two objects with the same values for their and properties may return the same hash code. This behavior could change in a future release. - + for unique values, as two objects with the same values for their and properties may return the same hash code. This behavior could change in a future release. + ]]> @@ -578,11 +579,11 @@ Gets or sets the vertical component of this structure. The vertical component of this structure, typically measured in pixels. - and of the structure depend on the and settings for the object that is used to draw. - + and of the structure depend on the and settings for the object that is used to draw. + ]]> @@ -697,15 +698,15 @@ Adds the width and height of one structure to the width and height of another structure. A structure that is the result of the addition operation. - operator. The example is designed to be used with Windows Forms. To run this example, paste it into a form that contains a button named `addButton` and associate the `addButton_Click` method with the button's event. - + operator. The example is designed to be used with Windows Forms. To run this example, paste it into a form that contains a button named `addButton` and associate the `addButton_Click` method with the button's event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet4"::: + ]]> @@ -838,17 +839,17 @@ if and have equal width and height; otherwise, . - class. - - This example is designed to be used with Windows Forms. Create a form that contains a named `subtractButton`. Paste the code into the form and call the `CreatePointsAndSizes` method from the form's event-handling method, passing `e` as . - + class. + + This example is designed to be used with Windows Forms. Create a form that contains a named `subtractButton`. Paste the code into the form and call the `CreatePointsAndSizes` method from the form's event-handling method, passing `e` as . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet1"::: + ]]> @@ -945,17 +946,17 @@ Converts the specified structure to a structure. The structure to which this operator converts. - , , , and properties of a and the member. - - This example is designed to be used with a Windows Form. Paste the code into the form and call the `ShowPropertiesOfSlateBlue` method from the form's event-handling method, passing `e` as . - + , , , and properties of a and the member. + + This example is designed to be used with a Windows Form. Paste the code into the form and call the `ShowPropertiesOfSlateBlue` method from the form's event-handling method, passing `e` as . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet3"::: + ]]> @@ -1229,15 +1230,15 @@ Subtracts the width and height of one structure from the width and height of another structure. A structure that is the result of the subtraction operation. - operator. The example is designed to be used with Windows Forms. To run the example, paste it into a form that contains a button named `subtractionButton` and associate the `subtractButton_Click` method with the button's event. - + operator. The example is designed to be used with Windows Forms. To run the example, paste it into a form that contains a button named `subtractionButton` and associate the `subtractButton_Click` method with the button's event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet2"::: + ]]> @@ -1287,15 +1288,15 @@ Converts the specified structure to a structure by rounding the values of the structure to the nearest integer values. The structure this method converts to. - and methods to convert a to a . This example is designed to be used with Windows Forms. To run this example, paste it into a form that contains two objects named `Label1` and `Label2`, and then call this method from the form's constructor. - + and methods to convert a to a . This example is designed to be used with Windows Forms. To run this example, paste it into a form that contains two objects named `Label1` and `Label2`, and then call this method from the form's constructor. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet5"::: + ]]> @@ -1346,14 +1347,14 @@ Subtracts the width and height of one structure from the width and height of another structure. A structure that is a result of the subtraction operation. - method. To run this example, paste it into a Windows Form. Handle the form's event and call the `SubtractSizes` method from the event-handling method, passing `e` as . - + method. To run this example, paste it into a Windows Form. Handle the form's event and call the `SubtractSizes` method from the event-handling method, passing `e` as . + :::code language="csharp" source="~/snippets/csharp/System.Drawing/CharacterRange/Equals/Form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.MiscWhidbeySnippets/VB/Form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.MiscWhidbeySnippets/VB/Form1.vb" id="Snippet12"::: + ]]> @@ -1459,15 +1460,15 @@ Converts the specified structure to a structure by truncating the values of the structure to the next lower integer values. The structure this method converts to. - and methods to convert a to a . This example is designed to be used with Windows Forms. To run this example, paste it into a form that contains two objects named `Label1` and `Label2`, and then call this method from the form's constructor. - + and methods to convert a to a . This example is designed to be used with Windows Forms. To run this example, paste it into a form that contains two objects named `Label1` and `Label2`, and then call this method from the form's constructor. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet5"::: + ]]> @@ -1527,11 +1528,11 @@ Gets or sets the horizontal component of this structure. The horizontal component of this structure, typically measured in pixels. - and of the structure depend on the and settings for the object used to draw. - + and of the structure depend on the and settings for the object used to draw. + ]]> diff --git a/xml/System.IO/File.xml b/xml/System.IO/File.xml index 36859ba730c..723dcb8d453 100644 --- a/xml/System.IO/File.xml +++ b/xml/System.IO/File.xml @@ -5548,7 +5548,7 @@ The following example moves a file. 4.0.0.0 - Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file. + Replaces the contents of a specified file with the contents of another file, deleting the original file and creating a backup of the replaced file. field values on Windows and ## Remarks -This method is intended to concatenate individual strings into a single string that represents a file path. However, if an argument other than the first contains a rooted path, any previous path components are ignored, and the returned string begins with that rooted path component. As an alternative to the `Combine` method, consider using the or methods. +This method is intended to concatenate individual strings into a single string that represents a file path. However, if an argument other than the first contains a rooted path, any previous path components are ignored, and the returned string begins with that rooted path component. As an alternative to the `Combine` method, consider using the or methods (not available in .NET Framework). > [!IMPORTANT] > This method assumes that the first argument is an absolute path and that the following argument or arguments are relative paths. If this is not the case, and particularly if any subsequent arguments are strings input by the user, call the or method instead. diff --git a/xml/System.Text.Json/JsonSerializerOptions.xml b/xml/System.Text.Json/JsonSerializerOptions.xml index e6be2736252..b4ea9feda15 100644 --- a/xml/System.Text.Json/JsonSerializerOptions.xml +++ b/xml/System.Text.Json/JsonSerializerOptions.xml @@ -670,7 +670,7 @@ Read-only fields are not deserialized regardless of this setting. System.Boolean - Gets a value that indicates whether read-only properties are ignored during serialization. The default value is . + Gets or sets a value that indicates whether read-only properties are ignored during serialization. The default value is . if read-only properties are ignored during serialization; otherwise, . @@ -1178,10 +1178,10 @@ Use to enable un "System.Text.Json.Serialization.RespectNullableAnnotationsDefault" feature switch. - Nullability validation functions independently of required-ness validation, + Nullability validation functions independently of required-ness validation, that is to say the setting has no effect in scenarios where the payload is missing a required property. - This can be configured independently using the keyword, - the attribute, + This can be configured independently using the keyword, + the attribute, or the property. diff --git a/xml/System.Windows.Forms/ListView.xml b/xml/System.Windows.Forms/ListView.xml index 32fa3330da7..5a07fbdfa1c 100644 --- a/xml/System.Windows.Forms/ListView.xml +++ b/xml/System.Windows.Forms/ListView.xml @@ -80,7 +80,7 @@ If the property set to `true`, you can perform tasks such as validating the text being edited before and after the text changed by creating an event handler for the and events. To perform tasks such as opening a file or displaying a dialog box to edit an item displayed in a , you can create an event handler for the event. If you allow the user to sort the items in a when they click a column header, you can create an event handler for the event to perform the sorting. When the property is set to `true`, you can determine when a change in an item's check state has occurred by handling the event. - You can also set a background image for the with the property. Your application must have the on its `Main` method to correctly display the background image for the control. In addition, if a control with a background image is hosted in Internet Explorer, specify comctl32.dll version 6.0 as a dependent assembly in the application manifest file to ensure the background image is property displayed. + You can also set a background image for the with the property. Your application must have the on its `Main` method to correctly display the background image for the control. In addition, if a control with a background image is hosted in Internet Explorer, specify comctl32.dll version 6.0 as a dependent assembly in the application manifest file to ensure the background image is properly displayed. Windows XP and Windows Server 2003 provide three features that enhance the control when your application calls the method: tile view, grouping, and the insertion mark. diff --git a/xml/System.Xml.Serialization/IXmlSerializable.xml b/xml/System.Xml.Serialization/IXmlSerializable.xml index 8aca43fb4fa..88a73afd6e7 100644 --- a/xml/System.Xml.Serialization/IXmlSerializable.xml +++ b/xml/System.Xml.Serialization/IXmlSerializable.xml @@ -66,23 +66,23 @@ Provides custom formatting for XML serialization and deserialization. - . For example, you can chunk data into bytes instead of buffering large data sets, and also avoid the inflation that occurs when the data is encoded using Base64 encoding. To control the serialization, implement the and methods to control the and classes used to read and write the XML. For an example of this, see [How to: Chunk Serialized Data](/dotnet/standard/serialization/how-to-chunk-serialized-data). - - The second reason is to be able to control the schema. To enable this, you must apply the to the serializable type, and specify the name of the static member that returns the schema. See the for an example. - - A class that implements the interface must have a parameterless constructor. This is a requirement of the class. - - - -## Examples - The following example code shows an implementation of the interface that serializes a private field. - + . For example, you can chunk data into bytes instead of buffering large data sets, and also avoid the inflation that occurs when the data is encoded using Base64 encoding. To control the serialization, implement the and methods to control the and classes used to read and write the XML. For an example of this, see [How to: Chunk Serialized Data](/dotnet/standard/serialization/how-to-chunk-serialized-data). + + The second reason is to be able to control the schema. To enable this, you must apply the to the serializable type, and specify the name of the static member that returns the schema. See the for an example. + + A class that implements the interface must have a parameterless constructor. This is a requirement of the class. + + + +## Examples + The following example code shows an implementation of the interface that serializes a private field. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/XmlSerialization_IXmlSerializable/CPP/person.cpp" id="Snippet0"::: - :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/person.cs" id="Snippet0"::: - + :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/person.cs" id="Snippet0"::: + ]]> Introducing XML Serialization @@ -146,15 +146,15 @@ This method is reserved and should not be used. When implementing the interface, you should return ( in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class. An that describes the XML representation of the object that is produced by the method and consumed by the method. - class does not perform XML validation. For this reason, it is often safe to omit schema information by providing a trivial implementation of this method, for example by returning `null` (`Nothing` in Visual Basic). - - If providing schema information is necessary, you should use the attribute. The `GetSchema` method should still return `null` (or `Nothing`). - - Some .NET Framework types as well as legacy custom types implementing the `IXmlSerializable` interface may be using `GetSchema` instead of `XmlSchemaProvider`. In this case, the method returns an accurate XML schema that describes the XML representation of the object generated by the method. - + class does not perform XML validation. For this reason, it is often safe to omit schema information by providing a trivial implementation of this method, for example by returning `null` (`Nothing` in Visual Basic). + + If providing schema information is necessary, you should use the attribute. The `GetSchema` method should still return `null` (or `Nothing`). + + Some .NET Framework types as well as legacy custom types implementing the `IXmlSerializable` interface may be using `GetSchema` instead of `XmlSchemaProvider`. In this case, the method returns an accurate XML schema that describes the XML representation of the object generated by the method. + ]]> @@ -208,28 +208,28 @@ The stream from which the object is deserialized. Generates an object from its XML representation. - method must reconstitute your object using the information that was written by the method. - - When this method is called, the reader is positioned on the start tag that wraps the information for your type. That is, directly on the start tag that indicates the beginning of a serialized object. When this method returns, it must have read the entire element from beginning to end, including all of its contents. Unlike the method, the framework does not handle the wrapper element automatically. Your implementation must do so. Failing to observe these positioning rules may cause code to generate unexpected runtime exceptions or corrupt data. - - When implementing this method, you should consider the possibility that a malicious user might provide a well-formed but invalid XML representation in order to disable or otherwise alter the behavior of your application. - - - -## Examples - The following example illustrates an implementation of the method. - + method must reconstitute your object using the information that was written by the method. + + When this method is called, the reader is positioned on the start tag that wraps the information for your type. That is, directly on the start tag that indicates the beginning of a serialized object. When this method returns, it must have read the entire element from beginning to end, including all of its contents. Unlike the method, the framework does not handle the wrapper element automatically. Your implementation must do so. Failing to observe these positioning rules may cause code to generate unexpected runtime exceptions or corrupt data. + + When implementing this method, you should consider the possibility that a malicious user might provide a well-formed but invalid XML representation in order to disable or otherwise alter the behavior of your application. + + + +## Examples + The following example illustrates an implementation of the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/XmlSerialization_IXmlSerializable/CPP/person.cpp" id="Snippet2"::: - :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/person.cs" id="Snippet2"::: - - The following example illustrates the use of the class to deserialize this object. - + :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/person.cs" id="Snippet2"::: + + The following example illustrates the use of the class to deserialize this object. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/XmlSerialization_IXmlSerializable/CPP/reader.cpp" id="Snippet20"::: - :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/reader.cs" id="Snippet20"::: - + :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/reader.cs" id="Snippet20"::: + ]]> @@ -283,28 +283,28 @@ The stream to which the object is serialized. Converts an object into its XML representation. - implementation you provide should write out the XML representation of the object. The framework writes a wrapper element and positions the XML writer after its start. Your implementation may write its contents, including child elements. The framework then closes the wrapper element. - - Write sufficient information to the stream to allow the method to reconstitute your object. - - For example, if your object state includes an array variable, be sure to write the length of the array, or use a parent element to contain the elements that describe the array values, so that you know how many values to read when the object is reconstituted. - - - -## Examples - The following example illustrates an implementation of the method. - + implementation you provide should write out the XML representation of the object. The framework writes a wrapper element and positions the XML writer after its start. Your implementation may write its contents, including child elements. The framework then closes the wrapper element. + + Write sufficient information to the stream to allow the method to reconstitute your object. + + For example, if your object state includes an array variable, be sure to write the length of the array, or use a parent element to contain the elements that describe the array values, so that you know how many values to read when the object is reconstituted. + + + +## Examples + The following example illustrates an implementation of the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/XmlSerialization_IXmlSerializable/CPP/person.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/person.cs" id="Snippet1"::: - - The following example illustrates the use of the class to deserialize this object. - + :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/person.cs" id="Snippet1"::: + + The following example illustrates the use of the class to serialize this object. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/XmlSerialization_IXmlSerializable/CPP/writer.cpp" id="Snippet10"::: - :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/writer.cs" id="Snippet10"::: - + :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/IXmlSerializable/Overview/writer.cs" id="Snippet10"::: + ]]>