diff --git a/xml/System/AccessViolationException.xml b/xml/System/AccessViolationException.xml index 70779860be7..6a63e0b1049 100644 --- a/xml/System/AccessViolationException.xml +++ b/xml/System/AccessViolationException.xml @@ -111,7 +111,7 @@ property of the new instance to a system-supplied message that describes the error, such as "Attempted to read or write protected memory. This is often an indication that other memory has been corrupted." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Attempted to read or write protected memory. This is often an indication that other memory has been corrupted." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -290,7 +290,7 @@ property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . diff --git a/xml/System/AggregateException.xml b/xml/System/AggregateException.xml index 3f3e25bf673..edcd891c6a4 100644 --- a/xml/System/AggregateException.xml +++ b/xml/System/AggregateException.xml @@ -150,7 +150,7 @@ property of the new instance to a system-supplied message that describes the error, such as "System.AggregateException: One or more errors occurred." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "System.AggregateException: One or more errors occurred." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -506,7 +506,7 @@ property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . @@ -632,7 +632,7 @@ exception before it is propagated to the parent task, which wraps that exception in its own exception before it propagates it back to the calling thread. In such cases, the property of the exception that is caught by the , , or method contains one or more instances, not the original exceptions that caused the fault. To avoid having to iterate over nested exceptions, you can use the method to remove all the nested exceptions, so that the property of the returned object contains the original exceptions. + If a task has an attached child task that throws an exception, that exception is wrapped in an exception before it is propagated to the parent task, which wraps that exception in its own exception before it propagates it back to the calling thread. In such cases, the property of the exception that is caught by the , , or method contains one or more instances, not the original exceptions that caused the fault. To avoid having to iterate over nested exceptions, you can use the method to remove all the nested exceptions, so that the property of the returned object contains the original exceptions. This method recursively flattens all instances of exceptions that are inner exceptions of the current instance. The inner exceptions returned in the new are the union of all the inner exceptions from exception tree rooted at the current instance. diff --git a/xml/System/AppContext.xml b/xml/System/AppContext.xml index c8b05038f42..2e6f5780e83 100644 --- a/xml/System/AppContext.xml +++ b/xml/System/AppContext.xml @@ -117,7 +117,7 @@ ## Remarks -This is a per-application domain property. Its value corresponds to the property of the current application domain. +This is a per-application domain property. Its value corresponds to the property of the current application domain. In .NET 5 and later versions, for bundled assemblies, the value returned is the containing directory of the host executable. @@ -383,7 +383,7 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the property. For a list of target framework names for .NET Framework, see the [<supportedRuntime> Element](/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element) element. + The name of the target framework version corresponds to the value of the property. For a list of target framework names for .NET Framework, see the [<supportedRuntime> Element](/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element) element. ]]> diff --git a/xml/System/AppDomain.xml b/xml/System/AppDomain.xml index 0dcae95109d..19290a27055 100644 --- a/xml/System/AppDomain.xml +++ b/xml/System/AppDomain.xml @@ -115,7 +115,7 @@ Application domains, which are represented by objects, h You should never create a remotable wrapper for an object. Doing so could publish a remote reference to that , exposing methods such as to remote access and effectively destroying code access security for that . Malicious clients connecting to the remoted could obtain access to any resource the itself has access to. Do not create remotable wrappers for any type that extends and that implements methods that could be used by malicious clients to bypass the security system. > [!CAUTION] -> The default value for the property is `false`. This setting is unsafe for services. To prevent services from downloading partially trusted code, set this property to `true`. +> The default value for the property is `false`. This setting is unsafe for services. To prevent services from downloading partially trusted code, set this property to `true`. ## Examples This example shows how to create a new , instantiate a type in that new , and communicate with that type's object. In addition, this example shows how to unload the causing the object to be garbage collected. @@ -244,7 +244,7 @@ Application domains, which are represented by objects, h property instead. + The use of this property is not recommended, because it might change the probing path for assemblies after they have already been loaded. Use the property instead. The private path, or relative search path, is the path relative to the base directory where the assembly resolver probes for private assemblies. @@ -539,16 +539,16 @@ Application domains, which are represented by objects, h for this event to return the assembly that is specified by the property, or to return null if the assembly is not recognized. The assembly must be loaded into an execution context; if it is loaded into the reflection-only context, the load that caused this event to be raised fails. + It is the responsibility of the for this event to return the assembly that is specified by the property, or to return null if the assembly is not recognized. The assembly must be loaded into an execution context; if it is loaded into the reflection-only context, the load that caused this event to be raised fails. For guidance on the use of this event, see [Resolving Assembly Loads](/dotnet/standard/assembly/resolve-loads). - Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. For example, the loader might be unable to load a dependency of the requesting assembly because the requesting assembly and its dependency are not in the probing path. Knowing the identity of the requesting assembly might be useful in locating the dependency or in identifying the correct version, if more than one version of the dependency is available. For more information, see . + Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. For example, the loader might be unable to load a dependency of the requesting assembly because the requesting assembly and its dependency are not in the probing path. Knowing the identity of the requesting assembly might be useful in locating the dependency or in identifying the correct version, if more than one version of the dependency is available. For more information, see . > [!IMPORTANT] > Beginning with the .NET Framework 4, the event is raised for all assemblies, including resource assemblies. In earlier versions, the event was not raised for resource assemblies. If the operating system is localized, the handler might be called multiple times: once for each culture in the fallback chain. - For this event, the property returns the assembly name before policy is applied. + For this event, the property returns the assembly name before policy is applied. > [!IMPORTANT] > If more than one event handler is registered for this event, the event handlers are called in order until an event handler returns a value that isn't `null`. Subsequent event handlers are ignored. @@ -629,12 +629,12 @@ Application domains, which are represented by objects, h property. It can also be retrieved using the method with the string "APPBASE". + This property corresponds to the property. It can also be retrieved using the method with the string "APPBASE". ## Examples - The following code example creates a new application domain, specifying a base directory to use when searching for assemblies to load into the domain. The example then uses the property to obtain the base directory path, for display to the console. + The following code example creates a new application domain, specifying a base directory to use when searching for assemblies to load into the domain. The example then uses the property to obtain the base directory path, for display to the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADSetup/CPP/adsetup.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/BaseDirectory/adsetup.cs" id="Snippet1"::: @@ -1261,7 +1261,7 @@ This method overload uses the information from the property of the object that you supply for `info`. Otherwise, an exception is thrown. + You must set the property of the object that you supply for `info`. Otherwise, an exception is thrown. If `securityInfo` is not supplied, the evidence from the current application domain is used. @@ -1922,7 +1922,7 @@ This method overload uses the information from the ## Remarks This is a convenience method that combines and . This method calls the parameterless constructor for `typeName`. - See for the format of `assemblyName`. See the property for the format of `typeName`. + See for the format of `assemblyName`. See the property for the format of `typeName`. > [!NOTE] > If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. @@ -2037,7 +2037,7 @@ This method overload uses the information from the ## Remarks This is a convenience method that combines and . This method calls the parameterless constructor for `typeName`. - See for the format of `assemblyName`. See the property for the format of `typeName`. + See for the format of `assemblyName`. See the property for the format of `typeName`. > [!NOTE] > If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. @@ -2157,7 +2157,7 @@ This method overload uses the information from the ## Remarks This is a convenience method that combines and . - See for the format of `assemblyName`. See the property for the format of `typeName`. + See for the format of `assemblyName`. See the property for the format of `typeName`. > [!NOTE] > If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. @@ -2380,7 +2380,7 @@ This method overload uses the information from the - Using the object directly when its type is known to the caller. The assembly must be loaded into the application domain of the caller. - Another way to avoid loading the called assembly into the application domain of the caller is for the caller to derive from the class and to define a method that can be run in the target application domain. That method can use reflection to examine a target assembly, because the target assembly is already loaded into the target application domain. See the example for the property. + Another way to avoid loading the called assembly into the application domain of the caller is for the caller to derive from the class and to define a method that can be run in the target application domain. That method can use reflection to examine a target assembly, because the target assembly is already loaded into the target application domain. See the example for the property. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.appdomain.createinstancefrom_stringstring/cpp/example.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateInstanceFrom/example.cs" id="Snippet1"::: @@ -3217,7 +3217,7 @@ This method overload uses the information from the property is used to obtain an object that represents the current application domain. The property provides the name of the current application domain, which is then displayed at the command line. + The following code example creates a new application domain. The property is used to obtain an object that represents the current application domain. The property provides the name of the current application domain, which is then displayed at the command line. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADApplicationBase/CPP/adapplicationbase.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CurrentDomain/adapplicationbase.cs" id="Snippet1"::: @@ -4415,19 +4415,19 @@ This method overload uses the information from the property of the object that will be used to create the new application domain. The base directory path you assign to the property is modified by the addition of a subdirectory whose simple name is the hash code of the string you assign to the property, so the format of the base directory is *original path*\\*hash code*. The dynamic directory is a subdirectory of this base directory. Its simple name is the value of the property, so its format is *original path*\\*hash code*\\*application name*. + To set the dynamic directory, assign a base directory path to the property of the object that will be used to create the new application domain. The base directory path you assign to the property is modified by the addition of a subdirectory whose simple name is the hash code of the string you assign to the property, so the format of the base directory is *original path*\\*hash code*. The dynamic directory is a subdirectory of this base directory. Its simple name is the value of the property, so its format is *original path*\\*hash code*\\*application name*. ## Examples The following example creates an application domain with a directory for dynamic assemblies, emits a dynamic assembly and stores it in the dynamic directory, and then loads the assembly into the new application domain and uses it. - The example creates an object and sets its property to "Example" and its property to "C:\DynamicAssemblyDir". The example then displays the property, to show that the hash code of the application name has been appended as a subdirectory of the path that was originally assigned. + The example creates an object and sets its property to "Example" and its property to "C:\DynamicAssemblyDir". The example then displays the property, to show that the hash code of the application name has been appended as a subdirectory of the path that was originally assigned. > [!NOTE] > The base directory in this example is intended to be outside the probing path for the example application. Be sure to compile the example in a different location. Delete the base directory and all its subdirectories each time you run the example. - The example creates a new application domain, using the object. The example uses the property to retrieve the name of the directory, so it can create the directory. (The example could just as easily create the directory beforehand by concatenating the original path, the hash code of the application name, and the application name.) + The example creates a new application domain, using the object. The example uses the property to retrieve the name of the directory, so it can create the directory. (The example could just as easily create the directory beforehand by concatenating the original path, the hash code of the application name, and the application name.) The example has a `GenerateDynamicAssembly` method that emits an assembly named `DynamicHelloWorld.dll` and stores it in the new application domain's dynamic directory. The dynamic assembly contains one type, `HelloWorld`, that has a static method (`Shared` method in Visual Basic) named `HelloFromAD`. Calling this method displays the name of the application domain. @@ -5607,7 +5607,7 @@ This method overload uses the information from the The friendly name of the default application domain is the file name of the process executable. For example, if the executable used to start the process is `"c:\MyAppDirectory\MyAssembly.exe"`, the friendly name of the default application domain is `"MyAssembly.exe"`. (In .NET Core and .NET 5+, the friendly name doesn't include the file extension.) ## Examples - The following code example uses the property to get the friendly name of the current application domain. For the default application domain, the friendly name is the name of the application's executable file. The code example also displays additional information about the application domain. + The following code example uses the property to get the friendly name of the current application domain. For the default application domain, the friendly name is the name of the application's executable file. The code example also displays additional information about the application domain. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADApplicationBase/CPP/adapplicationbase.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CurrentDomain/adapplicationbase.cs" id="Snippet1"::: @@ -5752,7 +5752,7 @@ The friendly name of the default application domain is the file name of the proc property, which is stable even when the .NET Framework is hosted by an environment that supports fibers (that is, lightweight threads). + Use the property, which is stable even when the .NET Framework is hosted by an environment that supports fibers (that is, lightweight threads). ]]> @@ -6213,7 +6213,7 @@ The friendly name of the default application domain is the file name of the proc An object's finalization method is called in one of the following situations: during garbage collection, when the common language runtime is shutting down, or when the application domain that contains the object is unloaded. The method returns `true` only in the last case; it does not return `true` if finalization results from routine garbage collection or from CLR shutdown. > [!NOTE] -> To determine whether finalization is due to CLR shutdown, use the property. It returns `true` if finalization is due to an application domain being unloaded or to the CLR shutting down. +> To determine whether finalization is due to CLR shutdown, use the property. It returns `true` if finalization is due to an application domain being unloaded or to the CLR shutting down. While executing in your finalization method during domain unloading, you might want to access another object that is referenced by a static field and has a finalization method. However, you cannot reliably do so because the accessed object might already have been finalized. @@ -6286,7 +6286,7 @@ The friendly name of the default application domain is the file name of the proc ## Examples - The following example demonstrates the property and the property with fully trusted and partially trusted application domains. The fully trusted application domain is the default application domain for the application. The partially trusted application domain is created by using the method overload. + The following example demonstrates the property and the property with fully trusted and partially trusted application domains. The fully trusted application domain is the default application domain for the application. The partially trusted application domain is created by using the method overload. The example uses a `Worker` class that derives from , so it can be marshaled across application domain boundaries. The example creates a `Worker` object in the default application domain. It then calls the `TestIsFullyTrusted` method to display the property value for the application domain and for two assemblies that are loaded into the application domain: mscorlib, which is part of the .NET Framework, and the example assembly. The application domain is fully trusted, so both assemblies are fully trusted. @@ -6347,7 +6347,7 @@ The friendly name of the default application domain is the file name of the proc ## Remarks This property returns `true` for sandboxed application domains that were created by using the method overload. Sandboxed application domains have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. - Fully trusted code can use the property to determine the homogenous grant set of a sandboxed application domain. + Fully trusted code can use the property to determine the homogenous grant set of a sandboxed application domain. This property also returns `true` for the default application domain of a desktop application, because that application domain grants full trust to all assemblies. @@ -6535,7 +6535,7 @@ The friendly name of the default application domain is the file name of the proc The assembly is loaded into both domains because does not derive from , and therefore the return value of the method cannot be marshaled. Instead, the common language runtime tries to load the assembly into the calling application domain. The assemblies that are loaded into the two application domains might be different if the path settings for the two application domains are different. > [!NOTE] -> If both the property and the property are set, the first attempt to load the assembly uses the display name (including version, culture, and so on, as returned by the property). If the file is not found, the property is used to search for the assembly. If the assembly is found using , the display name is matched against the assembly. If the match fails, a is thrown. +> If both the property and the property are set, the first attempt to load the assembly uses the display name (including version, culture, and so on, as returned by the property). If the file is not found, the property is used to search for the assembly. If the assembly is found using , the display name is matched against the assembly. If the match fails, a is thrown. ]]> @@ -7432,14 +7432,14 @@ The friendly name of the default application domain is the file name of the proc property. The for this event must return an assembly that satisfies the dependency. The assembly that is returned must be loaded into the reflection-only context. + In the reflection-only context, dependencies are not resolved automatically. They must be preloaded or returned by the handler for this event. This event is raised when an assembly has a dependency that is not already loaded into the reflection-only context. The missing dependency is specified by the property. The for this event must return an assembly that satisfies the dependency. The assembly that is returned must be loaded into the reflection-only context. > [!IMPORTANT] > This event is raised only for missing dependencies of the assembly that you are loading into the reflection-only context (for example, by using the method). It is not raised if the assembly that you are loading cannot be found. - Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. Knowing the identity of the requesting assembly might be useful in identifying the correct version of the dependency, if more than one version is available. For more information, see . + Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. Knowing the identity of the requesting assembly might be useful in identifying the correct version of the dependency, if more than one version is available. For more information, see . - For this event, the property returns the assembly name before policy is applied. + For this event, the property returns the assembly name before policy is applied. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -7572,7 +7572,7 @@ The friendly name of the default application domain is the file name of the proc property is not under , it is ignored. + Private assemblies are deployed in the same directory structure as the application. If the path specified by the property is not under , it is ignored. This property returns the value set using . @@ -7651,7 +7651,7 @@ The friendly name of the default application domain is the file name of the proc > [!IMPORTANT] > This event is not raised if resolution fails because no file can be found for a valid linked resource. It is raised if a manifest resource stream cannot be found, but it is not raised if an individual resource key cannot be found. - Beginning with the .NET Framework 4, the property contains the assembly that requested the resource. For more information, see . + Beginning with the .NET Framework 4, the property contains the assembly that requested the resource. For more information, see . To register an event handler for this event, you must have the required permissions, or a is thrown. @@ -7795,7 +7795,7 @@ The friendly name of the default application domain is the file name of the proc property is not set. See the property. + The cache path is ignored if the property is not set. See the property. For more information on shadow copying see [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). @@ -8036,7 +8036,7 @@ The friendly name of the default application domain is the file name of the proc property of the internal associated with this instance. + This method sets the property of the internal associated with this instance. ]]> @@ -8105,7 +8105,7 @@ The friendly name of the default application domain is the file name of the proc property. For example, if you set to a given principal (for example, a generic principal) and then use the method to set the to , the current principal will remain the generic principal. + Setting this value will only be effective if you set it before using the property. For example, if you set to a given principal (for example, a generic principal) and then use the method to set the to , the current principal will remain the generic principal. @@ -8272,7 +8272,7 @@ The friendly name of the default application domain is the file name of the proc The method does not specify additional directories to be searched for assemblies. Assemblies to be shadow-copied must already be located in the search path, for example under . The method specifies which search paths are eligible to be shadow-copied. - This method sets the property of the internal associated with this instance. + This method sets the property of the internal associated with this instance. For more information on shadow copying, see [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). @@ -8808,7 +8808,7 @@ The friendly name of the default application domain is the file name of the proc However, the event does not occur if the runtime knows it is not possible to find a type in certain assemblies. For example, this event does not occur if the type is not found in a static assembly because the runtime knows types cannot be added dynamically to static assemblies. - Beginning with the .NET Framework 4, the property contains the assembly that requested the type. For more information, see . + Beginning with the .NET Framework 4, the property contains the assembly that requested the type. For more information, see . To register an event handler for this event, you must have the required permissions, or a is thrown. diff --git a/xml/System/AppDomainManager.xml b/xml/System/AppDomainManager.xml index d21d22fea3d..1ce20c55b23 100644 --- a/xml/System/AppDomainManager.xml +++ b/xml/System/AppDomainManager.xml @@ -28,38 +28,38 @@ Provides a managed equivalent of an unmanaged host. - [!IMPORTANT] -> Do not use to configure an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host. - - Implementing the class enables a hosting application to participate in the creation of new application domains. To replace the default , identify the assembly and type of the replacement in the APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE environment variables, or use the [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagerassembly-element) and [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagertype-element) elements in your configuration file. The assembly must be fully trusted and be contained in the global assembly cache or the directory of the starting application. The type and assembly names must be fully qualified in the environment variables. For example: - - `set APPDOMAIN_MANAGER_TYPE=MyNamespace.TestAppDomainManager` - - `set APPDOMAIN_MANAGER_ASM=customappDomainmanager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f1368f7b12a08d72` - +> Do not use to configure an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host. + + Implementing the class enables a hosting application to participate in the creation of new application domains. To replace the default , identify the assembly and type of the replacement in the APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE environment variables, or use the [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagerassembly-element) and [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagertype-element) elements in your configuration file. The assembly must be fully trusted and be contained in the global assembly cache or the directory of the starting application. The type and assembly names must be fully qualified in the environment variables. For example: + + `set APPDOMAIN_MANAGER_TYPE=MyNamespace.TestAppDomainManager` + + `set APPDOMAIN_MANAGER_ASM=customappDomainmanager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f1368f7b12a08d72` + > [!IMPORTANT] -> If the assembly that contains your subclass of depends on assemblies that are marked with the conditional (APTCA) attribute, you must include those assemblies in the list that you pass to the property of the you use to create application domains. Otherwise, the assemblies that are marked with the conditional APTCA attribute will be disabled. - - The is the managed equivalent of the unmanaged host. An object participates in the creation of new application domains in a process and can customize the new before other managed code runs. The can also supply host managers that participate in other aspects of common language runtime execution. For example, an can identify a object that participates in the security decisions of the application domain. - +> If the assembly that contains your subclass of depends on assemblies that are marked with the conditional (APTCA) attribute, you must include those assemblies in the list that you pass to the property of the you use to create application domains. Otherwise, the assemblies that are marked with the conditional APTCA attribute will be disabled. + + The is the managed equivalent of the unmanaged host. An object participates in the creation of new application domains in a process and can customize the new before other managed code runs. The can also supply host managers that participate in other aspects of common language runtime execution. For example, an can identify a object that participates in the security decisions of the application domain. + > [!NOTE] -> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. - +> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. + > [!NOTE] -> This class contains a link demand and an inheritance demand at the class level. A is thrown when either the immediate caller or the derived class does not have infrastructure 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 shows a very simple implementation of . - +> This class contains a link demand and an inheritance demand at the class level. A is thrown when either the immediate caller or the derived class does not have infrastructure 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 shows a very simple implementation of . + :::code language="csharp" source="~/snippets/csharp/System/AppDomainManager/Overview/customAppDomainManager.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet1"::: + ]]> The caller does not have the correct permissions. See the Requirements section. @@ -81,13 +81,13 @@ Initializes a new instance of the class. - [!NOTE] -> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. - +> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. + ]]> @@ -112,11 +112,11 @@ Gets the application activator that handles the activation of add-ins and manifest-based applications for the domain. The application activator. - class in each to which all add-in and manifest-based application activation calls are routed. The for the current can provide its own custom , or an instance of the default is created. - + class in each to which all add-in and manifest-based application activation calls are routed. The for the current can provide its own custom , or an instance of the default is created. + ]]> @@ -146,13 +146,13 @@ if the host allows the operation specified by to be performed in the application domain; otherwise, . - method has been called to increase the isolated storage quota. An application that hosts the common language runtime (CLR) can override the method to perform policy decisions based on an object (which inherits ), and can then allow or prevent the increase. For example, a host could prompt the end user to approve or deny the request to increase the quota. The host's implementation of should take into account the possibility of denial-of-service attacks. For example, it should prompt the user only if the method is called from a user-initiated event such as a button click. - + method has been called to increase the isolated storage quota. An application that hosts the common language runtime (CLR) can override the method to perform policy decisions based on an object (which inherits ), and can then allow or prevent the increase. For example, a host could prompt the end user to approve or deny the request to increase the quota. The host's implementation of should take into account the possibility of denial-of-service attacks. For example, it should prompt the user only if the method is called from a user-initiated event such as a button click. + ]]> @@ -191,13 +191,13 @@ Returns a new or existing application domain. A new or existing application domain. - property. - - The default method calls the protected method to create the . Overrides of this method do not need to call the method but can return an existing domain. - + property. + + The default method calls the protected method to create the . Overrides of this method do not need to call the method but can return an existing domain. + ]]> @@ -239,13 +239,13 @@ Provides a helper method to create an application domain. A newly created application domain. - property. - + property. + ]]> @@ -278,11 +278,11 @@ Gets the entry assembly for an application. The entry assembly for the application. - method. - + method. + ]]> @@ -307,11 +307,11 @@ Gets the host execution context manager that manages the flow of the execution context. The host execution context manager. - that can participate in the flow of the execution context across asynchronous calls. - + that can participate in the flow of the execution context across asynchronous calls. + ]]> @@ -336,19 +336,19 @@ Gets the host security manager that participates in security decisions for the application domain. The host security manager. - to participate in the security decisions for the application domain. - - - -## Examples - The following example shows an override of the property for a custom application domain manager. This code example is part of a larger example provided for the class. - + to participate in the security decisions for the application domain. + + + +## Examples + The following example shows an override of the property for a custom application domain manager. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System/AppDomainManager/Overview/customAppDomainManager.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet3"::: + ]]> @@ -404,30 +404,30 @@ An object that contains application domain initialization information. Initializes the new application domain. - [!IMPORTANT] -> Do not use this method to initialize an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host. If you use this method to initialize the application domain, the host throws when it attempts to initialize the application domain. The exception message indicates that initialization has already occurred. - - This method is called immediately after the constructor. The default implementation does nothing. A custom implementation can set up internal classes and delegates, set up an interface with the unmanaged host interface, or set up event handlers for the new . - - Also, for add-in activations, a custom implementation could identify the current as the target application domain. - - Beginning with the .NET Framework 4, you can use this method to sandbox the default application domain at application startup, or to modify the sandbox of a new application domain. To do this, adjust the and properties on the object that is assigned to the property of `appDomainInfo`, before you initialize the application domain. - +> Do not use this method to initialize an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host. If you use this method to initialize the application domain, the host throws when it attempts to initialize the application domain. The exception message indicates that initialization has already occurred. + + This method is called immediately after the constructor. The default implementation does nothing. A custom implementation can set up internal classes and delegates, set up an interface with the unmanaged host interface, or set up event handlers for the new . + + Also, for add-in activations, a custom implementation could identify the current as the target application domain. + + Beginning with the .NET Framework 4, you can use this method to sandbox the default application domain at application startup, or to modify the sandbox of a new application domain. To do this, adjust the and properties on the object that is assigned to the property of `appDomainInfo`, before you initialize the application domain. + > [!NOTE] -> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. - - - -## Examples - The following example shows an override of the method for a custom application domain manager. This code example is part of a larger example provided for the class. - +> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. + + + +## Examples + The following example shows an override of the method for a custom application domain manager. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System/AppDomainManager/Overview/customAppDomainManager.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet2"::: + ]]> diff --git a/xml/System/AppDomainSetup.xml b/xml/System/AppDomainSetup.xml index e35c956cfdb..4960eb50311 100644 --- a/xml/System/AppDomainSetup.xml +++ b/xml/System/AppDomainSetup.xml @@ -78,7 +78,7 @@ This class implements the interface. > [!CAUTION] -> The default value for the property is false. This setting is unsafe for services. To help prevent services from downloading partially trusted code, set this property to true +> The default value for the property is false. This setting is unsafe for services. To help prevent services from downloading partially trusted code, set this property to true ]]> @@ -156,7 +156,7 @@ object specified for `activationContext` is used to generate an object containing information required to activate a new application domain. This object can be accessed by using the property. + The object specified for `activationContext` is used to generate an object containing information required to activate a new application domain. This object can be accessed by using the property. ]]> @@ -202,7 +202,7 @@ property. + The object specified for `activationArguments` can be accessed by using the property. ]]> @@ -283,14 +283,14 @@ property. The array is passed to the callback method each time an is initialized. + To pass information to the callback method, assign an array of strings to the property. The array is passed to the callback method each time an is initialized. The callback method is executed in the context of the newly created application domain. ## Examples - The following example creates a child application domain named `ChildDomain`, using an object and evidence from the default application domain. The property is set to the callback method `AppDomainInit`, which is invoked when the child domain is initialized. The arguments for the callback method are placed in an array of strings, which is assigned to the property. When the child domain is created, the callback method simply prints the strings. + The following example creates a child application domain named `ChildDomain`, using an object and evidence from the default application domain. The property is set to the callback method `AppDomainInit`, which is invoked when the child domain is initialized. The arguments for the callback method are placed in an array of strings, which is assigned to the property. When the child domain is created, the callback method simply prints the strings. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomainInitializer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomainSetup/AppDomainInitializer/source.cs" id="Snippet1"::: @@ -332,14 +332,14 @@ property to specify a callback method that is invoked during initialization. If the property is not set, the array assigned to this property is not used. + Use the property to specify a callback method that is invoked during initialization. If the property is not set, the array assigned to this property is not used. The callback method is executed in the context of the newly created application domain. ## Examples - The following code example creates a child application domain named `ChildDomain`, using an object and evidence from the default application domain. The property is set to the callback method `AppDomainInit`, which is invoked when the child domain is initialized. The arguments for the callback method are placed in an array of strings, which is assigned to the property. When the child domain is created, the callback method simply prints the strings. + The following code example creates a child application domain named `ChildDomain`, using an object and evidence from the default application domain. The property is set to the callback method `AppDomainInit`, which is invoked when the child domain is initialized. The arguments for the callback method are placed in an array of strings, which is assigned to the property. When the child domain is created, the callback method simply prints the strings. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomainInitializer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomainSetup/AppDomainInitializer/source.cs" id="Snippet1"::: @@ -380,17 +380,17 @@ property. If either of these properties is not set, the other is ignored. + To specify the type of the application domain manager, set both this property and the property. If either of these properties is not set, the other is ignored. If no type is provided, the application domain manager is created from the same type as the parent application domain (that is, the application domain from which the method is called). - When the application domain is loaded, is thrown if the assembly does not exist, or if the assembly does not contain the type specified by the property. is thrown if the assembly is found but the version information does not match. + When the application domain is loaded, is thrown if the assembly does not exist, or if the assembly does not contain the type specified by the property. is thrown if the assembly is found but the version information does not match. To set the application domain manager for the default application domain, use the [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagerassembly-element) and [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagertype-element) elements in the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of the application configuration file, or use the environment variables described in . This feature requires the application to have full trust. (For example, an application running on the desktop has full trust.) If the application does not have full trust, a is thrown. - The format of the assembly display name is given by the property. + The format of the assembly display name is given by the property. ]]> @@ -424,17 +424,17 @@ property. If either of these properties is not set, the other is ignored. + To specify the type of the application domain manager, set both this property and the property. If either of these properties is not set, the other is ignored. If no type is provided, the application domain manager is created from the same type as the parent application domain (that is, the application domain from which the method is called). - When the application domain is loaded, is thrown if the assembly specified by the property does not contain the type specified by this property. + When the application domain is loaded, is thrown if the assembly specified by the property does not contain the type specified by this property. To set the application domain manager for the default application domain, use the [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagerassembly-element) and [\](/dotnet/framework/configure-apps/file-schema/runtime/appdomainmanagertype-element) elements in the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of the application configuration file, or use the environment variables described in . This feature requires the application to have full trust. (For example, an application running on the desktop has full trust.) If the application does not have full trust, a is thrown. - The format of the full name of a type is given by the property. + The format of the full name of a type is given by the property. ]]> @@ -495,12 +495,12 @@ ## Remarks The application base directory is where the assembly manager begins probing for assemblies. - The property can influence which permissions are granted to an application domain. For example, an application domain originating from the local computer normally receives full trust based on its location of origin. However, if the property of that is set to the full name of an intranet directory, the setting restricts the permissions granted to the application domain to a LocalIntranet grant even though the application domain actually originates from the local computer. + The property can influence which permissions are granted to an application domain. For example, an application domain originating from the local computer normally receives full trust based on its location of origin. However, if the property of that is set to the full name of an intranet directory, the setting restricts the permissions granted to the application domain to a LocalIntranet grant even though the application domain actually originates from the local computer. ## Examples - The following example demonstrates how to use the property to set the location where the assembly loader begins probing for assemblies to load into a new application domain. + The following example demonstrates how to use the property to set the location where the assembly loader begins probing for assemblies to load into a new application domain. > [!NOTE] > You must ensure that the folder you specify exists. @@ -547,7 +547,7 @@ property when you create a new application domain. + The following example shows how to set the property when you create a new application domain. The example creates a new application domain, and then calls the method to load the example assembly into the new application domain and create an instance of the `Worker` class. The `Worker` class inherits , so the example can use the proxy returned by to call the `TestLoad` method. @@ -650,7 +650,7 @@ property must also be set. If the property is not set, the property is ignored and the shadow copy cache location defaults to the download cache. + In order for this property to have an effect, the property must also be set. If the property is not set, the property is ignored and the shadow copy cache location defaults to the download cache. For more information on shadow copying, see [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). @@ -739,9 +739,9 @@ property is `true`, the value of the property is ignored. That is, no assemblies are probed for in the directories specified by the property. In addition, the values of the property and the property are ignored. No assemblies are probed for in the directories specified by the property. + If the property is `true`, the value of the property is ignored. That is, no assemblies are probed for in the directories specified by the property. In addition, the values of the property and the property are ignored. No assemblies are probed for in the directories specified by the property. - The property provides an additional layer of control over the loading process. In the normal assembly loading sequence, the application base is probed before the event is raised. However, some applications might need to load assemblies from an OLE compound file within a document, or from a unique known location that is neither in the global assembly cache nor in the directories specified by the and properties. Such applications can use the property to avoid the delay caused by normal probing, and to avoid loading copies of the necessary assembly that might be located in the normal probing paths. + The property provides an additional layer of control over the loading process. In the normal assembly loading sequence, the application base is probed before the event is raised. However, some applications might need to load assemblies from an OLE compound file within a document, or from a unique known location that is neither in the global assembly cache nor in the directories specified by the and properties. Such applications can use the property to avoid the delay caused by normal probing, and to avoid loading copies of the necessary assembly that might be located in the normal probing paths. ]]> @@ -778,7 +778,7 @@ property is designed to be used by services and server applications where assembly binding redirection is not part of the application scenario. + The property is designed to be used by services and server applications where assembly binding redirection is not part of the application scenario. The value of this property is only considered when loading strong-named assemblies. Assemblies that do not have a strong-name will always have binding redirects applied. @@ -817,10 +817,10 @@ property is designed to be used by services and server applications where downloading code from an intranet or the Internet is not part of the application scenario. + The property is designed to be used by services and server applications where downloading code from an intranet or the Internet is not part of the application scenario. > [!CAUTION] -> The default value for the property is `false`. This setting is unsafe for services. To help prevent services from downloading partially trusted code, set this property to `true`. +> The default value for the property is `false`. This setting is unsafe for services. To help prevent services from downloading partially trusted code, set this property to `true`. ]]> @@ -857,7 +857,7 @@ property specifically applies to a Web application that is loaded locally. Use this property to help prevent a malicious attempt to execute an unsafe Web application in safe mode. + The property specifically applies to a Web application that is loaded locally. Use this property to help prevent a malicious attempt to execute an unsafe Web application in safe mode. For more information about bypassing publisher policy, see the [Redirecting Assembly Versions](/dotnet/framework/configure-apps/redirect-assembly-versions) topic. For more information about safe mode, see the "Examining the Configuration Files" section of the [How the Runtime Locates Assemblies](/dotnet/framework/deployment/how-the-runtime-locates-assemblies) topic. @@ -908,24 +908,24 @@ property. Dynamic assemblies that will be loaded and executed by the new application domain can be placed there. + Use this property to set the base directory where the dynamic directory for the new application domain will be located. When code in the new application domain loads an assembly, assembly resolution looks first in the normal probing paths. If it does not find the assembly, it looks in the dynamic directory, which is returned by the property. Dynamic assemblies that will be loaded and executed by the new application domain can be placed there. - When you assign a path to the property, an additional subdirectory is added; the name of this subdirectory is the hash code of the value assigned to the property. Thus, the base directory subsequently returned by this property is always different from the value assigned. + When you assign a path to the property, an additional subdirectory is added; the name of this subdirectory is the hash code of the value assigned to the property. Thus, the base directory subsequently returned by this property is always different from the value assigned. > [!IMPORTANT] > Assigning a value to this property does not create any directories. The directories must be created or verified by the code that uses them. - The dynamic directory is a subdirectory of . Its simple name is the value returned by the property, so its format is *original path*\\*hash code*\\*application name*. + The dynamic directory is a subdirectory of . Its simple name is the value returned by the property, so its format is *original path*\\*hash code*\\*application name*. ## Examples - The following example demonstrates how to use the property to set the path an application domain probes when loading dynamic assemblies. + The following example demonstrates how to use the property to set the path an application domain probes when loading dynamic assemblies. - The example creates an object and sets its property to "Example" and its property to "C:\DynamicAssemblyDir". The example then displays the property, to show that the hash code of the application name has been appended as a subdirectory of the path that was originally assigned. + The example creates an object and sets its property to "Example" and its property to "C:\DynamicAssemblyDir". The example then displays the property, to show that the hash code of the application name has been appended as a subdirectory of the path that was originally assigned. > [!NOTE] > The base directory in this example is intended to be outside the probing path for the example application. Be sure to compile the example in a different location. Delete the base directory and all its subdirectories each time you run the example. - The example creates a new application domain using the object. The example then creates the dynamic directory if it does not already exist. Although the example uses the application domain's property to get the name of the dynamic directory, it could just as easily create the directory beforehand by concatenating the original path, the hash code of the application name, and the application name. + The example creates a new application domain using the object. The example then creates the dynamic directory if it does not already exist. Although the example uses the application domain's property to get the name of the dynamic directory, it could just as easily create the directory beforehand by concatenating the original path, the hash code of the application name, and the application name. The example has a `GenerateDynamicAssembly` method that emits an assembly named `DynamicHelloWorld.dll` and stores it in the new application domain's dynamic directory. The dynamic assembly contains one type, `HelloWorld`, that has a static method (`Shared` method in Visual Basic) named `HelloFromAD`. Calling this method displays the name of the application domain. @@ -976,11 +976,11 @@ The method provides a way to override the configuration information of an application that creates a new application domain. The configuration file information in `value` overrides the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can override the configuration information originally obtained from Example.exe.config file. > [!IMPORTANT] -> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is overridden in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. +> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is overridden in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. The XML in `value` is the same as the XML in a normal configuration file, except that it is stored as a array. - To access the configuration bytes for an application domain, use the property to get the object for the application domain, then use the method. + To access the configuration bytes for an application domain, use the property to get the object for the application domain, then use the method. ]]> @@ -1054,7 +1054,7 @@ property to set the optimization policy used to load the assembly into an application domain. + The following example creates a dynamic assembly and saves it to disk, and then uses the property to set the optimization policy used to load the assembly into an application domain. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADDyno/CPP/addyno.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateInstanceAndUnwrap/addyno.cs" id="Snippet1"::: @@ -1093,12 +1093,12 @@ (APTCA) attribute can be made conditional by setting its property to . An APTCA assembly that is marked with cannot be used by partially trusted code unless the host application allows it. + Beginning with the .NET Framework 4, the (APTCA) attribute can be made conditional by setting its property to . An APTCA assembly that is marked with cannot be used by partially trusted code unless the host application allows it. The host of a sandboxed application domain allows code in the application domain to use assemblies with conditional APTCA attributes by creating an array that contains the simple name and public key of each assembly, and assigning the array to this property. For example, an element of the array might look like the following: "MyAssembly, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db2ad5e5fedc67ea526ff72ad426ef68e08e241d296c499eedfec6648dcc62b1a12f72be5833a45bbec481b68415b08a5fbc9f9ef247b523dd72bbea65bb532784ddc5c704544bd2f1c2d46fdbe41e4f949e76f9947357b2d5cf8ca9f970701bbd6e8ab64ad31b20ad0be9b56dae4f6b83332b92a2a3b8ea2804c40efbc0b6b9". > [!IMPORTANT] -> If you are using a subclass of , and the assembly that defines it depends on assemblies that are marked with the conditional APTCA attribute, you must include those assemblies in the list that you pass to the property of the you use to create application domains. Otherwise the assemblies that are marked with the conditional APTCA attribute will be disabled. +> If you are using a subclass of , and the assembly that defines it depends on assemblies that are marked with the conditional APTCA attribute, you must include those assemblies in the list that you pass to the property of the you use to create application domains. Otherwise the assemblies that are marked with the conditional APTCA attribute will be disabled. > [!NOTE] > When you are debugging an application that is running in a sandboxed application domain, some messages can be misleading. For example, a message might state that one of your fully trusted assemblies has only limited permissions, when the real cause of the problem is that a security demand that exceeds the grant set of the sandboxed application domain has propagated to the boundary of the sandboxed application domain and failed. @@ -1323,7 +1323,7 @@ The method provides a way to replace the configuration information of an application that creates a new application domain. The configuration file information in `value` replaces the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can replace the configuration information originally obtained from the Example.exe.config file. > [!IMPORTANT] -> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is replaced in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. +> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is replaced in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. The XML in `value` is the same as the XML in a normal configuration file, except that it is stored as a array. @@ -1440,9 +1440,9 @@ and properties. The property restricts the shadow copy to the assemblies in the directories specified by . + When shadow copying is enabled, the default is to shadow copy all assemblies found through probing; that is, in the directories specified by the and properties. The property restricts the shadow copy to the assemblies in the directories specified by . - If you don't assign a string to the property, or if you set this property to `null`, all assemblies in the directories specified by the and properties are shadow copied. + If you don't assign a string to the property, or if you set this property to `null`, all assemblies in the directories specified by the and properties are shadow copied. > [!IMPORTANT] > Directory paths must not contain semicolons, because the semicolon is the delimiter character. There is no escape character for semicolons. @@ -1542,7 +1542,7 @@ ## Remarks Set this property to tell the currently running version of the .NET Framework that the application domain will be used to load and run assemblies that have been compiled for the target version and profile. If the currently running version of the .NET Framework has optional behaviors that affect the compatibility of code that was compiled with the target version, it can enable or disable those behaviors, as appropriate, to improve compatibility. This can be useful when an application supports add-ins compiled with multiple versions of the .NET Framework by running them in separate application domains. - For client applications, the value of the property is inferred from the attribute. In Visual Studio 2010 and later, this attribute is added to the assembly automatically based on the setting of the project's **Target Framework** property. + For client applications, the value of the property is inferred from the attribute. In Visual Studio 2010 and later, this attribute is added to the assembly automatically based on the setting of the project's **Target Framework** property. ]]> diff --git a/xml/System/AppDomainUnloadedException.xml b/xml/System/AppDomainUnloadedException.xml index ed873f2eb15..a2b5d19ce1c 100644 --- a/xml/System/AppDomainUnloadedException.xml +++ b/xml/System/AppDomainUnloadedException.xml @@ -169,7 +169,7 @@ property of the new instance to a system-supplied message that describes the error, such as "The target application domain has been unloaded." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "The target application domain has been unloaded." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -362,7 +362,7 @@ ## Remarks The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or a null reference if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or a null reference if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . diff --git a/xml/System/ApplicationException.xml b/xml/System/ApplicationException.xml index 6c77096a243..b9cb211511c 100644 --- a/xml/System/ApplicationException.xml +++ b/xml/System/ApplicationException.xml @@ -61,13 +61,13 @@ Serves as the base class for application-defined exceptions. - [!IMPORTANT] -> You should derive custom exceptions from the class rather than the class. You should not throw an exception in your code, and you should not catch an exception unless you intend to re-throw the original exception. - +> You should derive custom exceptions from the class rather than the class. You should not throw an exception in your code, and you should not catch an exception unless you intend to re-throw the original exception. + ]]> @@ -121,18 +121,18 @@ Initializes a new instance of the class. - property of the new instance to a system-supplied message that describes the error, such as "An application error has occurred." This message takes into account the current system culture. - - The following table shows the initial property values for an instance of . - -|Property|Value| -|--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| - + property of the new instance to a system-supplied message that describes the error, such as "An application error has occurred." This message takes into account the current system culture. + + The following table shows the initial property values for an instance of . + +|Property|Value| +|--------------|-----------| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| + ]]> @@ -178,20 +178,20 @@ A message that describes the error. Initializes a new instance of the class with a specified error message. - . - -|Property|Value| -|--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -|`Message`|The error message string.| - + . + +|Property|Value| +|--------------|-----------| +||A null reference (`Nothing` in Visual Basic).| +|`Message`|The error message string.| + ]]> @@ -252,11 +252,11 @@ The contextual information about the source or destination. Initializes a new instance of the class with serialized data. - XML and Soap Serialization @@ -305,20 +305,20 @@ The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a block that handles the inner exception. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - property. The property returns the same value that is passed into the constructor, or a null reference if the property does not supply the inner exception value to the constructor. - - The following table shows the initial property values for an instance of . - -|Property|Value| -|--------------|-----------| -||The inner exception reference.| -||The error message string.| - + property. The property returns the same value that is passed into the constructor, or a null reference if the property does not supply the inner exception value to the constructor. + + The following table shows the initial property values for an instance of . + +|Property|Value| +|--------------|-----------| +||The inner exception reference.| +||The error message string.| + ]]> diff --git a/xml/System/ApplicationId.xml b/xml/System/ApplicationId.xml index abccbdc23ae..4b31cd11fb8 100644 --- a/xml/System/ApplicationId.xml +++ b/xml/System/ApplicationId.xml @@ -287,7 +287,7 @@ ## Examples - The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. + The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/ApplicationId/Overview/program.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/ApplicationId/Overview/program.fs" id="Snippet8"::: @@ -463,7 +463,7 @@ ## Examples - The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. + The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/ApplicationId/Overview/program.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/ApplicationId/Overview/program.fs" id="Snippet7"::: @@ -530,7 +530,7 @@ ## Examples - The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. + The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/ApplicationId/Overview/program.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/ApplicationId/Overview/program.fs" id="Snippet9"::: @@ -592,7 +592,7 @@ ## Examples - The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. + The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/ApplicationId/Overview/program.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/ApplicationId/Overview/program.fs" id="Snippet11"::: @@ -704,7 +704,7 @@ ## Examples - The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. + The following code example displays the property by obtaining the from an instance created using the for the currently executing manifest-based application. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/ApplicationId/Overview/program.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System/ApplicationId/Overview/program.fs" id="Snippet10"::: diff --git a/xml/System/ApplicationIdentity.xml b/xml/System/ApplicationIdentity.xml index 4fc36d4781e..ace1cf67c87 100644 --- a/xml/System/ApplicationIdentity.xml +++ b/xml/System/ApplicationIdentity.xml @@ -49,19 +49,19 @@ Provides the ability to uniquely identify a manifest-activated application. This class cannot be inherited. - class is used in the activation of manifest-based applications. - - - -## Examples - The following code example demonstrates the use of an object to obtain the for a manifest-based application. This code example is part of a larger example provided for the class. - + class is used in the activation of manifest-based applications. + + + +## Examples + The following code example demonstrates the use of an object to obtain the for a manifest-based application. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System/ActivationContext/Overview/program.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActivationContext/Overview/program.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System/ActivationContext/Overview/program.vb" id="Snippet2"::: + ]]> @@ -105,65 +105,65 @@ The full name of the application. Initializes a new instance of the class. - @@ -209,23 +209,23 @@ http://testserver/ActivationContext/ActivationContext.application Gets the location of the deployment manifest as a URL. The URL of the deployment manifest. - property values for an application named ActivationContext: - -- `http://testserver/ActivationContext/ActivationContext.application` - -- `file://C:/UserFiles/UserName/SolutionName/ActivationContext/publish/ActivationContext.application`. - - - -## Examples - The following code example demonstrates the use of an object to obtain the value of the property for a manifest-based application. This code example is part of a larger example provided for the class. - + property values for an application named ActivationContext: + +- `http://testserver/ActivationContext/ActivationContext.application` + +- `file://C:/UserFiles/UserName/SolutionName/ActivationContext/publish/ActivationContext.application`. + + + +## Examples + The following code example demonstrates the use of an object to obtain the value of the property for a manifest-based application. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System/ActivationContext/Overview/program.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActivationContext/Overview/program.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System/ActivationContext/Overview/program.vb" id="Snippet3"::: + ]]> @@ -269,19 +269,19 @@ http://testserver/ActivationContext/ActivationContext.application Gets the full name of the application. The full name of the application, also known as the display name. - property, see the constructor. - - - -## Examples - The following code example demonstrates the use of an object to obtain the value of the property for a manifest-based application. This code example is part of a larger example provided for the class. - + property, see the constructor. + + + +## Examples + The following code example demonstrates the use of an object to obtain the value of the property for a manifest-based application. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System/ActivationContext/Overview/program.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActivationContext/Overview/program.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System/ActivationContext/Overview/program.vb" id="Snippet3"::: + ]]> @@ -369,11 +369,11 @@ http://testserver/ActivationContext/ActivationContext.application Returns the full name of the manifest-activated application. The full name of the manifest-activated application. - constructor. - + constructor. + ]]> diff --git a/xml/System/ArgumentException.xml b/xml/System/ArgumentException.xml index bee482888b0..01ba6ad722a 100644 --- a/xml/System/ArgumentException.xml +++ b/xml/System/ArgumentException.xml @@ -81,9 +81,9 @@ is thrown when a method is invoked and at least one of the passed arguments does not meet the parameter specification of the called method. The property identifies the invalid argument. + is thrown when a method is invoked and at least one of the passed arguments does not meet the parameter specification of the called method. The property identifies the invalid argument. - Most commonly, an is thrown by the common language runtime or another class library and indicates developer error. If you throw an from your code, you should ensure that the exception's property includes a meaningful error message that describes the invalid argument and the expected range of values for the argument. + Most commonly, an is thrown by the common language runtime or another class library and indicates developer error. If you throw an from your code, you should ensure that the exception's property includes a meaningful error message that describes the invalid argument and the expected range of values for the argument. The primary derived classes of are and . These derived classes should be used instead of , except in situations where neither of the derived classes is acceptable. For example, exceptions should be thrown by: @@ -101,7 +101,7 @@ In F#, you can use the [invalidArg](/dotnet/fsharp/language-reference/exception- ## Examples -The following example demonstrates how to throw and catch an . It uses the [ArgumentException.GetType().Name](xref:System.Type.Name%2A) property to display the name of the exception object, and also uses the property to display the text of the exception message. +The following example demonstrates how to throw and catch an . It uses the [ArgumentException.GetType().Name](xref:System.Type.Name) property to display the name of the exception object, and also uses the property to display the text of the exception message. :::code language="csharp" source="~/snippets/csharp/System/ArgumentException/Overview/argumentexception2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/ArgumentException/FS/argumentexception2.fs" id="Snippet3"::: @@ -169,7 +169,7 @@ The following example demonstrates how to throw and catch an property of the new instance to a system-supplied message that describes the error, such as "An invalid argument was specified." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "An invalid argument was specified." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -230,7 +230,7 @@ The following example demonstrates how to throw and catch an property of the new instance to a system-supplied message that describes the error, such as "An invalid argument was specified." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "An invalid argument was specified." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -359,9 +359,9 @@ The following example demonstrates how to throw and catch an property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. + This constructor initializes the property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . @@ -426,9 +426,9 @@ The following example demonstrates how to throw and catch an property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. + This constructor initializes the property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - This constructor initializes the property of the new instance using `paramName`. The content of `paramName` is intended to be understood by humans. + This constructor initializes the property of the new instance using `paramName`. The content of `paramName` is intended to be understood by humans. The following table shows the initial property values for an instance of . @@ -499,11 +499,11 @@ The following example demonstrates how to throw and catch an property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. + This constructor initializes the property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - This constructor initializes the property of the new instance using `paramName`. The content of `paramName` is intended to be understood by humans. + This constructor initializes the property of the new instance using `paramName`. The content of `paramName` is intended to be understood by humans. - An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . diff --git a/xml/System/ArgumentNullException.xml b/xml/System/ArgumentNullException.xml index 055a18a6b16..1f2fb084efa 100644 --- a/xml/System/ArgumentNullException.xml +++ b/xml/System/ArgumentNullException.xml @@ -145,7 +145,7 @@ property of the new instance to a system-supplied message that describes the error, such as "Value cannot be null." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Value cannot be null." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -206,9 +206,9 @@ property of the new instance to a system-supplied message that describes the error and includes the parameter name. This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error and includes the parameter name. This message takes into account the current system culture. - This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. + This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. The following table shows the initial property values for an instance of . @@ -386,9 +386,9 @@ property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. + This constructor initializes the property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. + This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. The following table shows the initial property values for an instance of . diff --git a/xml/System/ArgumentOutOfRangeException.xml b/xml/System/ArgumentOutOfRangeException.xml index 6e5404f0b25..1a6a780ddb2 100644 --- a/xml/System/ArgumentOutOfRangeException.xml +++ b/xml/System/ArgumentOutOfRangeException.xml @@ -76,7 +76,7 @@ ## Remarks -An exception is thrown when a method is invoked and at least one of the arguments passed to the method is not `null` and contains an invalid value that is not a member of the set of values expected for the argument. The property identifies the invalid argument, and the property, if a value is present, identifies the invalid value. +An exception is thrown when a method is invoked and at least one of the arguments passed to the method is not `null` and contains an invalid value that is not a member of the set of values expected for the argument. The property identifies the invalid argument, and the property, if a value is present, identifies the invalid value. Typically, an results from developer error. Instead of handling the exception in a `try`/`catch` block, you should eliminate the cause of the exception or, if the argument is returned by a method call or input by the user before being passed to the method that throws the exception, you should validate arguments before passing them to the method. @@ -148,7 +148,7 @@ The conditions in which an exception i There are four common causes of this exception: - 1. You are working with an empty string, or . Because its property returns 0, any attempt to manipulate it by index throws an exception. The following example, defines a `GetFirstCharacter` method that returns the first character of a string. If the string is empty, as the final string passed to the method is, the method throws an exception. + 1. You are working with an empty string, or . Because its property returns 0, any attempt to manipulate it by index throws an exception. The following example, defines a `GetFirstCharacter` method that returns the first character of a string. If the string is empty, as the final string passed to the method is, the method throws an exception. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/EmptyString1.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/EmptyString1.fs" id="Snippet15"::: @@ -317,7 +317,7 @@ The following example defines a class to contain information about an invited gu property of the new instance to a system-supplied message that describes the error, such as "Nonnegative number required." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Nonnegative number required." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -378,9 +378,9 @@ The following example defines a class to contain information about an invited gu property of the new instance to a system-supplied message that describes the error, such as "Nonnegative number required." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Nonnegative number required." This message takes into account the current system culture. - This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. + This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. The following table shows the initial property values for an instance of . @@ -558,9 +558,9 @@ The following example defines a class to contain information about an invited gu property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. + This constructor initializes the property of the new instance using the value of the `message` parameter. The content of the `message` parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. + This constructor initializes the property of the new instance using the `paramName` parameter. The content of `paramName` is intended to be understood by humans. The following table shows the initial property values for an instance of . @@ -626,11 +626,11 @@ The following example defines a class to contain information about an invited gu property of the new instance using the `paramName` parameter, the property using the `actualValue` parameter, and the property using the `message` parameter. The content of the `paramName` and `message` parameters is intended to be understood by humans. The caller of this constructor is required to ensure that these strings have been localized for the current system culture. + This constructor initializes the property of the new instance using the `paramName` parameter, the property using the `actualValue` parameter, and the property using the `message` parameter. The content of the `paramName` and `message` parameters is intended to be understood by humans. The caller of this constructor is required to ensure that these strings have been localized for the current system culture. - The `actualValue` parameter is not used within the .NET class library. However, apps can use the property to obtain the available argument value. + The `actualValue` parameter is not used within the .NET class library. However, apps can use the property to obtain the available argument value. - The `actualValue` parameter contains the invalid value that was passed to the method and caused this exception to be thrown. This value is stored in the property and its string representation is appended to the message string held in the property. + The `actualValue` parameter contains the invalid value that was passed to the method and caused this exception to be thrown. This value is stored in the property and its string representation is appended to the message string held in the property. The following table shows the initial property values for an instance of . @@ -703,9 +703,9 @@ The following example defines a class to contain information about an invited gu The `ActualValue` property returns the same value that was passed to the constructor, or `null` if no value was supplied. - The property is assigned a value at the time of object construction. If the property value is not `null`, a string representation of the value is appended to the message string held by the property. + The property is assigned a value at the time of object construction. If the property value is not `null`, a string representation of the value is appended to the message string held by the property. - The property is not used within the .NET class library. It carries a null value in all the objects thrown by the .NET class library. The property is provided so that applications can use the available argument value. + The property is not used within the .NET class library. It carries a null value in all the objects thrown by the .NET class library. The property is provided so that applications can use the available argument value. This property is read-only and should be overridden only to customize the content or format of the value. diff --git a/xml/System/ArithmeticException.xml b/xml/System/ArithmeticException.xml index 8e89df46e4d..55ebcea311a 100644 --- a/xml/System/ArithmeticException.xml +++ b/xml/System/ArithmeticException.xml @@ -151,7 +151,7 @@ property of the new instance to a system-supplied message that describes the error, such as "The arithmetic operation is not allowed." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "The arithmetic operation is not allowed." This message takes into account the current system culture. The following table shows initial property values for an instance of . @@ -341,7 +341,7 @@ property. The property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the property does not supply the inner exception value to the constructor. The following table shows initial property values for an instance of . diff --git a/xml/System/Array.xml b/xml/System/Array.xml index 22586a8461c..be2a2ba9255 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -6213,7 +6213,7 @@ implements the property because it is required by the interface. + implements the property because it is required by the interface. An array with a fixed size does not allow the addition or removal of elements after the array is created, but it allows the modification of existing elements. @@ -6274,11 +6274,11 @@ implements the property because it is required by the interface. An array that is read-only does not allow the addition, removal, or modification of elements after the array is created. + implements the property because it is required by the interface. An array that is read-only does not allow the addition, removal, or modification of elements after the array is created. If you require a read-only collection, use a class that implements the interface. - If you cast or convert an array to an interface object, the property returns `false`. However, if you cast or convert an array to a interface, the `IsReadOnly` property returns `true`. + If you cast or convert an array to an interface object, the property returns `false`. However, if you cast or convert an array to a interface, the `IsReadOnly` property returns `true`. Retrieving the value of this property is an O(1) operation. @@ -6339,11 +6339,11 @@ implements the property because it is required by the interface. + implements the property because it is required by the interface. - .NET classes based on provide their own synchronized version of the collection using the property. + .NET classes based on provide their own synchronized version of the collection using the property. - Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. + Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -6352,7 +6352,7 @@ ## Examples - The following code example shows how to lock an array during the entire enumeration by using the property. + The following code example shows how to lock an array during the entire enumeration by using the property. :::code language="csharp" source="~/snippets/csharp/System/Array/IsSynchronized/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array.SyncRoot/fs/source.fs" id="Snippet1"::: @@ -7022,7 +7022,7 @@ ## Examples - The following example uses the property to get the total number of elements in an array. It also uses the method to determine the number of elements in each dimension of a multidimensional array. + The following example uses the property to get the total number of elements in an array. It also uses the method to determine the number of elements in each dimension of a multidimensional array. :::code language="csharp" source="~/snippets/csharp/System/Array/Length/length1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.length/fs/length1.fs" id="Snippet1"::: @@ -7210,7 +7210,7 @@ This property only applies to single-dimension, zero-bound (SZ) arrays. property whose value is 3. + For example, the following code creates an array of three dimensions with a property whose value is 3. ```vb Dim TDArray(0,0,0) As Integer @@ -7220,14 +7220,14 @@ Dim TDArray(0,0,0) As Integer int[,,] TDArray = new int[1,1,1]; ``` - A jagged array (an array of arrays) is a one-dimensional array; the value of its property is 1. + A jagged array (an array of arrays) is a one-dimensional array; the value of its property is 1. Retrieving the value of this property is an O(1) operation. ## Examples - The following example initializes a one-dimensional array, a two-dimensional array, and a jagged array, and retrieves the property of each. + The following example initializes a one-dimensional array, a two-dimensional array, and a jagged array, and retrieves the property of each. :::code language="csharp" source="~/snippets/csharp/System/Array/Rank/rank1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.rank/fs/rank1.fs" id="Snippet1"::: @@ -10638,16 +10638,16 @@ This method is an O(`n` log `n`) operation, where `n` is the interface. -.NET classes based on provide their own synchronized version of the collection using the property. +.NET classes based on provide their own synchronized version of the collection using the property. - Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. + Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. Retrieving the value of this property is an O(1) operation. ## Examples - The following code example shows how to lock an array during the entire enumeration by using the property. + The following code example shows how to lock an array during the entire enumeration by using the property. :::code language="csharp" source="~/snippets/csharp/System/Array/IsSynchronized/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array.SyncRoot/fs/source.fs" id="Snippet1"::: @@ -10850,7 +10850,7 @@ This member is an explicit interface member implementation. It can be used only implementation adds a member to a collection. However, because arrays have a fixed size (the property always returns `true`), this method always throws a exception. + Ordinarily, an implementation adds a member to a collection. However, because arrays have a fixed size (the property always returns `true`), this method always throws a exception. This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. diff --git a/xml/System/ArraySegment`1.xml b/xml/System/ArraySegment`1.xml index 673b0a370cb..bff0e413b55 100644 --- a/xml/System/ArraySegment`1.xml +++ b/xml/System/ArraySegment`1.xml @@ -123,7 +123,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/segmentexample.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/ArraySegmentT/Overview/segmentexample.vb" id="Snippet2"::: - Note, however, that although the structure can be used to divide an array into distinct segments, the segments are not completely independent of one another. The property returns the entire original array, not a copy of the array; therefore, changes made to the array returned by the property are made to the original array. If this is undesirable, you should perform operations on a copy of the array, rather than an object that represents a portion of the array. + Note, however, that although the structure can be used to divide an array into distinct segments, the segments are not completely independent of one another. The property returns the entire original array, not a copy of the array; therefore, changes made to the array returned by the property are made to the original array. If this is undesirable, you should perform operations on a copy of the array, rather than an object that represents a portion of the array. The method and the equality and inequality operators test for reference equality when they compare two objects. For two objects to be considered equal, they must meet all of the following conditions: @@ -133,7 +133,7 @@ - Have the same number of elements. - If you want to retrieve an element by its index in the object, you must cast it to an object and retrieve it or modify it by using the property. Note that this is not necessary in F#. The following example retrieves the element in an object that delimits a section of a string array. + If you want to retrieve an element by its index in the object, you must cast it to an object and retrieve it or modify it by using the property. Note that this is not necessary in F#. The following example retrieves the element in an object that delimits a section of a string array. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.arraysegment.class/fs/example1.fs" id="Snippet1"::: @@ -224,7 +224,7 @@ that delimits all the elements of `array`. That is, the property of the is 0 and its property is the length of `array`. To create an that delimits only part of an array, use the constructor. + This constructor creates an that delimits all the elements of `array`. That is, the property of the is 0 and its property is the length of `array`. To create an that delimits only part of an array, use the constructor. The original array must be one-dimensional and must have zero-based indexing. @@ -355,7 +355,7 @@ property returns the original array, not a copy of the array; therefore, changes made through the property are made directly to the original array. + The property returns the original array, not a copy of the array; therefore, changes made through the property are made directly to the original array. diff --git a/xml/System/ArrayTypeMismatchException.xml b/xml/System/ArrayTypeMismatchException.xml index 532fce80d8b..351fe99b748 100644 --- a/xml/System/ArrayTypeMismatchException.xml +++ b/xml/System/ArrayTypeMismatchException.xml @@ -158,7 +158,7 @@ property of the new instance to a system-supplied message that describes the error, such as "Source array type cannot be assigned to destination array type." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Source array type cannot be assigned to destination array type." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -366,7 +366,7 @@ property. The property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . diff --git a/xml/System/Attribute.xml b/xml/System/Attribute.xml index 9f3bef8a23c..4cad2b20342 100644 --- a/xml/System/Attribute.xml +++ b/xml/System/Attribute.xml @@ -3040,7 +3040,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example implements the property in a custom parameter class and shows its use. + The following code example implements the property in a custom parameter class and shows its use. :::code language="csharp" source="~/snippets/csharp/System/Attribute/TypeId/typeid.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Attribute.TypeId/FS/typeid.fs" id="Snippet1"::: diff --git a/xml/System/AttributeUsageAttribute.xml b/xml/System/AttributeUsageAttribute.xml index d1e7c58f213..2d5c1f04791 100644 --- a/xml/System/AttributeUsageAttribute.xml +++ b/xml/System/AttributeUsageAttribute.xml @@ -262,7 +262,7 @@ property determines: + The property determines: - Whether classes derived from a base class tagged with the attribute to which the attribute is applied inherit that attribute. @@ -271,7 +271,7 @@ ## Examples - The following example illustrates the difference between an attribute to which an attribute with an property value of `true` is applied and one to which attribute with an property value of `false` is applied. The example defines two attributes, `InheritedAttribute` and `NotInheritedAttribute`. Both attributes can apply to classes and methods. Because the property of the attribute applied to `InheritedAttribute` is `true`, it is inherited by derived classes and the members of derived classes that override the base class method. On the other hand, because the property of the attribute applied to `NotInheritedAttribute` is `false`, it is not inherited by derived classes and the members of derived classes that override the base class method. + The following example illustrates the difference between an attribute to which an attribute with an property value of `true` is applied and one to which attribute with an property value of `false` is applied. The example defines two attributes, `InheritedAttribute` and `NotInheritedAttribute`. Both attributes can apply to classes and methods. Because the property of the attribute applied to `InheritedAttribute` is `true`, it is inherited by derived classes and the members of derived classes that override the base class method. On the other hand, because the property of the attribute applied to `NotInheritedAttribute` is `false`, it is not inherited by derived classes and the members of derived classes that override the base class method. :::code language="csharp" source="~/snippets/csharp/System/AttributeUsageAttribute/Inherited/Inherited1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.AttributeUsageAttribute.Inherited/fs/Inherited1.fs" id="Snippet1"::: diff --git a/xml/System/BadImageFormatException.xml b/xml/System/BadImageFormatException.xml index 7ed9541b208..86a6b6a9dbb 100644 --- a/xml/System/BadImageFormatException.xml +++ b/xml/System/BadImageFormatException.xml @@ -186,7 +186,7 @@ property of the new instance to a system-supplied message that describes the error, such as "Format of the executable or library is invalid." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Format of the executable or library is invalid." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -375,7 +375,7 @@ property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . @@ -503,7 +503,7 @@ property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . @@ -737,7 +737,7 @@ property is not a null reference (`Nothing` in Visual Basic), the message includes the file name. + If no message was supplied to the constructor for the current exception, this property returns a system-supplied error message. If the property is not a null reference (`Nothing` in Visual Basic), the message includes the file name. This property is read-only. @@ -799,7 +799,7 @@ property, the result of calling `ToString` on the inner exception, the value of the property, and the result of calling . If any of these members is a null reference (`Nothing` in Visual Basic), its value is not included in the returned string. + The string representation returned by this method includes the name of the exception, the value of the property, the result of calling `ToString` on the inner exception, the value of the property, and the result of calling . If any of these members is a null reference (`Nothing` in Visual Basic), its value is not included in the returned string. ]]> diff --git a/xml/System/Byte.xml b/xml/System/Byte.xml index 9228a98f2c0..d28da245b3a 100644 --- a/xml/System/Byte.xml +++ b/xml/System/Byte.xml @@ -1668,7 +1668,7 @@ For , this method matches the IEEE 754: |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of s if style includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional positive sign. (The method throws an if a negative sign is present in `s`.) The sign can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The current culture's decimal point symbol can appear in `s` if `style` includes the flag.| @@ -2025,7 +2025,7 @@ For , this method matches the IEEE 754: |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional positive sign. (The method throws an if a negative sign is present in `s`.) The sign can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The decimal point symbol of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -6853,7 +6853,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional positive sign, as specified by the property of the current culture.| +|*sign*|An optional positive sign, as specified by the property of the current culture.| |*digits*|A sequence of decimal digits that range from 0 to 9.| The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. @@ -7208,7 +7208,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of s if style includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional positive sign. (The parse operation fails if a negative sign is present in `s`.) The sign can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The decimal point symbol of the culture specified by `provider` can appear in `s` if `style` includes the flag.| diff --git a/xml/System/CannotUnloadAppDomainException.xml b/xml/System/CannotUnloadAppDomainException.xml index cbac72b4ce0..0748986631b 100644 --- a/xml/System/CannotUnloadAppDomainException.xml +++ b/xml/System/CannotUnloadAppDomainException.xml @@ -147,7 +147,7 @@ property of the new instance to a system-supplied message that describes the error, such as "Attempt to unload the AppDomain failed." This message takes into account the current system culture. + This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "Attempt to unload the AppDomain failed." This message takes into account the current system culture. The following table shows the initial property values for an instance of . @@ -338,7 +338,7 @@ property. The property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . diff --git a/xml/System/CharEnumerator.xml b/xml/System/CharEnumerator.xml index 9560cdd2758..ccc0c936e20 100644 --- a/xml/System/CharEnumerator.xml +++ b/xml/System/CharEnumerator.xml @@ -90,7 +90,7 @@ A maintains an internal index to the characters in the string the references. The state of the index is invalid when it references a character position logically before the first character or after the last character in the string, and valid when it references a character within the string. The index is initialized to a position logically before the first character, and is set to a position after the last character when the iteration is complete. An exception is thrown if you attempt to access a character while the index is invalid. - The method increments the index by one, so the first and subsequent characters are accessed in turn. The method sets the index to a position logically before the first character. The property retrieves the character currently referenced by index. The method creates a copy of the . + The method increments the index by one, so the first and subsequent characters are accessed in turn. The method sets the index to a position logically before the first character. The property retrieves the character currently referenced by index. The method creates a copy of the . > [!NOTE] > Several independent instances of across one or more threads can have access to a single instance of . This class is implemented to support the interface. For more information regarding the use of an enumerator, see the topic. @@ -98,7 +98,7 @@ ## Examples - The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. + The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. :::code language="csharp" source="~/snippets/csharp/System/CharEnumerator/Overview/CharEnumerator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/fs/CharEnumerator1.fs" id="Snippet1"::: @@ -230,7 +230,7 @@ class maintains an internal index to the enumerated string, and the property returns the character that is currently referenced by the index. This property should be invoked only when the index is valid; otherwise, an exception is thrown. + The class maintains an internal index to the enumerated string, and the property returns the character that is currently referenced by the index. This property should be invoked only when the index is valid; otherwise, an exception is thrown. The index is always invalid for an empty string (""). The index is also invalid after the or method is called. After either of these methods is called, invoke the method to adjust the index to the first character in the enumerated string. The index is valid whenever the method returns `true`. @@ -239,7 +239,7 @@ ## Examples - The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. + The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. :::code language="csharp" source="~/snippets/csharp/System/CharEnumerator/Overview/CharEnumerator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/fs/CharEnumerator1.fs" id="Snippet1"::: @@ -366,7 +366,7 @@ Notice that if the enumerated string is empty (""), the state of the is always invalid. This is because the internal index for the is initially before the first character of the enumerated string and is therefore invalid. logically sets the index after the last (nonexistent) character of the enumerated string, which is also invalid. ## Examples - The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. + The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. :::code language="csharp" source="~/snippets/csharp/System/CharEnumerator/Overview/CharEnumerator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/fs/CharEnumerator1.fs" id="Snippet1"::: diff --git a/xml/System/Console.xml b/xml/System/Console.xml index 5d4a687d5ba..756e5552f39 100644 --- a/xml/System/Console.xml +++ b/xml/System/Console.xml @@ -129,7 +129,7 @@ property affects only output that is written to individual character cells after the background color is changed. To change the background color of the console window as a whole, set the property and call the method. The following example provides an illustration. + A change to the property affects only output that is written to individual character cells after the background color is changed. To change the background color of the console window as a whole, set the property and call the method. The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Console/BackgroundColor/backgroundcolor1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.backgroundcolor/fs/backgroundcolor1.fs" id="Snippet1"::: @@ -393,9 +393,9 @@ property defines the number of rows that are actually displayed in the console window at any particular time. If the number of rows actually written to the buffer exceeds the number of rows defined by the property, the window can be scrolled vertically so that it displays a contiguous number of rows that are equal to the property and are located anywhere in the buffer. + This property defines the number of rows (or lines) stored in the buffer that is accessed by a console mode window. In contrast, the property defines the number of rows that are actually displayed in the console window at any particular time. If the number of rows actually written to the buffer exceeds the number of rows defined by the property, the window can be scrolled vertically so that it displays a contiguous number of rows that are equal to the property and are located anywhere in the buffer. - If a set operation decreases the value of the property, the uppermost lines are removed. For example, if the number of lines is reduced from 300 to 250, lines 0 through 49 are removed, and the existing lines 50 through 299 become lines 0 through 249. + If a set operation decreases the value of the property, the uppermost lines are removed. For example, if the number of lines is reduced from 300 to 250, lines 0 through 49 are removed, and the existing lines 50 through 299 become lines 0 through 249. ## Examples @@ -494,7 +494,7 @@ property, the rightmost columns are removed. For example, if the number of columns is reduced from 80 to 60, columns 60 through 79 of each row are removed. + If a set operation decreases the value of the property, the rightmost columns are removed. For example, if the number of columns is reduced from 80 to 60, columns 60 through 79 of each row are removed. @@ -600,17 +600,17 @@ - , which allows you to determine whether the handler was invoked as a result of the user pressing Ctrl+C (the property value is ) or Ctrl+Break (the property value is ). -- , which allows you to determine how your application should respond to the user pressing Ctrl+C or Ctrl+Break. By default, the property is `false`, which causes program execution to terminate when the event handler exits. Changing its property to `true` specifies that the application should continue to execute. +- , which allows you to determine how your application should respond to the user pressing Ctrl+C or Ctrl+Break. By default, the property is `false`, which causes program execution to terminate when the event handler exits. Changing its property to `true` specifies that the application should continue to execute. > [!TIP] -> If your application has simple requirements, you can use the property instead of this event. By setting this property to `false`, you can ensure that your application always exits if the user presses Ctrl+C. By setting it to `true`, you can ensure that pressing Ctrl+C will not terminate the application. +> If your application has simple requirements, you can use the property instead of this event. By setting this property to `false`, you can ensure that your application always exits if the user presses Ctrl+C. By setting it to `true`, you can ensure that pressing Ctrl+C will not terminate the application. The event handler for this event is executed on a thread pool thread. ## Examples - The following example demonstrates how the event is used. When you press Ctrl+C, the read operation is interrupted and the `myHandler` event handler is invoked. Upon entry to the event handler, the property is `false`, which means that the current process will terminate when the event handler terminates. However, the event handler sets the property to `true`, which means that the process will not terminate and the read operation will resume. + The following example demonstrates how the event is used. When you press Ctrl+C, the read operation is interrupted and the `myHandler` event handler is invoked. Upon entry to the event handler, the property is `false`, which means that the current process will terminate when the event handler terminates. However, the event handler sets the property to `true`, which means that the process will not terminate and the read operation will resume. :::code language="csharp" source="~/snippets/csharp/System/Console/CancelKeyPress/ckp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cancelkeypress/fs/ckp.fs" id="Snippet1"::: @@ -929,7 +929,7 @@ ## Examples - This example demonstrates the property. The example increases the size of the cursor each time any console key is pressed, then restores the cursor to its original size before terminating. + This example demonstrates the property. The example increases the size of the cursor each time any console key is pressed, then restores the cursor to its original size before terminating. :::code language="csharp" source="~/snippets/csharp/System/Console/CursorSize/csize.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cursorsize/FS/csize.fs" id="Snippet1"::: @@ -1103,7 +1103,7 @@ property. The example makes the cursor visible if the first column of input is a '+' character or invisible if the input is a '-' character. + This example demonstrates the property. The example makes the cursor visible if the first column of input is a '+' character or invisible if the input is a '-' character. :::code language="csharp" source="~/snippets/csharp/System/Console/CursorVisible/vis.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cursorvis/FS/vis.fs" id="Snippet1"::: @@ -1168,7 +1168,7 @@ ## Remarks This standard error stream is set to the console by default. It can be set to another stream with the method. After the standard error stream is redirected, it can be reacquired by calling the method. - In console applications whose informational output is often redirected to a file, the standard error stream available through the property can be used to display information to the console even if output is redirected. The following example displays product tables for 10 numbers at a time starting with 1. After every set of 10 numbers, the property is used to ask the user whether to display the next set. If the standard output is redirected to a file, the user is still asked whether the routine should generate the next set of products. + In console applications whose informational output is often redirected to a file, the standard error stream available through the property can be used to display information to the console even if output is redirected. The following example displays product tables for 10 numbers at a time starting with 1. After every set of 10 numbers, the property is used to ask the user whether to display the next set. If the standard output is redirected to a file, the user is still asked whether the routine should generate the next set of products. :::code language="csharp" source="~/snippets/csharp/System/Console/Error/error1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.error/fs/error1.fs" id="Snippet1"::: @@ -1177,7 +1177,7 @@ ## Examples - The following example is a command line utility named ExpandTabs that replaces tab characters in a text file with four spaces, the value defined by the `tabSize` variable. It redirects the standard input and output streams to files, but uses the property to write the standard error stream to the console. It can be launched from the command line by supplying the name of the file that contains tab characters and the name of the output file. + The following example is a command line utility named ExpandTabs that replaces tab characters in a text file with four spaces, the value defined by the `tabSize` variable. It redirects the standard input and output streams to files, but uses the property to write the standard error stream to the console. It can be launched from the command line by supplying the name of the file that contains tab characters and the name of the output file. :::code language="csharp" source="~/snippets/csharp/System/Console/Error/expandtabsex.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Console-EXPANDTABSEX/FS/expandtabsex.fs" id="Snippet1"::: @@ -1189,7 +1189,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.openstandarderror/fs/viewtextfile.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Error/viewtextfile.vb" id="Snippet1"::: - Note that the property is set to `true` before reacquiring the error stream. This ensures that output will be sent to the console immediately rather than buffered. + Note that the property is set to `true` before reacquiring the error stream. This ensures that output will be sent to the console immediately rather than buffered. ]]> @@ -1424,7 +1424,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks This property is set to the standard input stream by default. This property can be set to another stream with the method. - Read operations on the standard input stream execute synchronously. That is, they block until the specified read operation has completed. This is true even if an asynchronous method, such as , is called on the object returned by the property. + Read operations on the standard input stream execute synchronously. That is, they block until the specified read operation has completed. This is true even if an asynchronous method, such as , is called on the object returned by the property. @@ -1515,7 +1515,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks The console uses the input encoding to translate keyboard input into a corresponding character. The input encoding incorporates a code page that maps 256 keyboard character codes to individual characters. Different code pages include different special characters, typically customized for a language or a group of languages. - Starting with the .NET Framework 4, a property get operation may return a cached value instead of the console's current input encoding. This can occur if the value of the property is modified by some means other than an assignment to the property, such as calling the Windows `SetConsoleCP` function or using the `chcp` command from a PowerShell script. + Starting with the .NET Framework 4, a property get operation may return a cached value instead of the console's current input encoding. This can occur if the value of the property is modified by some means other than an assignment to the property, such as calling the Windows `SetConsoleCP` function or using the `chcp` command from a PowerShell script. ]]> @@ -1728,14 +1728,14 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to property does not block input until a key press is available. + The property value is returned immediately; that is, the property does not block input until a key press is available. - Use the property in conjunction with only the method, not the or methods. + Use the property in conjunction with only the method, not the or methods. ## Examples - The following example demonstrates how to use the property to create a loop that runs until a key is pressed. + The following example demonstrates how to use the property to create a loop that runs until a key is pressed. :::code language="csharp" source="~/snippets/csharp/System/Console/KeyAvailable/ka.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.keyavailable/FS/ka.fs" id="Snippet1"::: @@ -2202,7 +2202,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.openstandarderror/fs/viewtextfile.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Error/viewtextfile.vb" id="Snippet1"::: - Note that the property is set to `true` before reacquiring the error stream. This ensures that output will be sent to the console immediately rather than buffered. + Note that the property is set to `true` before reacquiring the error stream. This ensures that output will be sent to the console immediately rather than buffered. ]]> @@ -2626,7 +2626,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The following example uses the property to display an array containing the names of files in the application's current directory to the standard output device. It then sets the standard output to a file named Files.txt and lists the array elements to the file. Finally, it sets the output to the standard output stream and again displays the array elements to the standard output device. + The following example uses the property to display an array containing the names of files in the application's current directory to the standard output device. It then sets the standard output to a file named Files.txt and lists the array elements to the file. Finally, it sets the output to the standard output stream and again displays the array elements to the standard output device. :::code language="csharp" source="~/snippets/csharp/System/Console/Out/out1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.out/fs/out1.fs" id="Snippet1"::: @@ -2706,7 +2706,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks The console uses the output encoding to translate characters written by an application into corresponding console display characters. The default code page that the console uses is determined by the system locale. - Starting with the .NET Framework 4, a property get operation may return a cached value instead of the console's current output encoding. This can occur if the value of the property is modified by some means other than an assignment to the property, such as calling the Windows `SetConsoleOutputCP` function. + Starting with the .NET Framework 4, a property get operation may return a cached value instead of the console's current output encoding. This can occur if the value of the property is modified by some means other than an assignment to the property, such as calling the Windows `SetConsoleOutputCP` function. ]]> @@ -2784,7 +2784,7 @@ This method can be used to reacquire the standard output stream after it has bee The method blocks its return while you type input characters; it terminates when you press the key. Pressing Enter appends a platform-dependent line termination sequence to your input (for example, Windows appends a carriage return-linefeed sequence). Subsequent calls to the method retrieve your input one character at a time. After the final character is retrieved, blocks its return again and the cycle repeats. > [!IMPORTANT] -> The method, or the property and method are preferable to using the method. +> The method, or the property and method are preferable to using the method. Note that the method does not return -1 unless you perform one of the following actions: @@ -2883,7 +2883,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks The method waits, that is, blocks on the thread issuing the method, until a character or function key is pressed. A character or function key can be pressed in combination with one or more Alt, Ctrl, or Shift modifier keys. However, pressing a modifier key by itself will not cause the method to return. - Depending on your application, you might want to use the method in conjunction with the property. + Depending on your application, you might want to use the method in conjunction with the property. The method reads from the keyboard even if the standard input is redirected to a file with the method. @@ -2984,7 +2984,7 @@ This method can be used to reacquire the standard output stream after it has bee If the `intercept` parameter is `true`, the pressed key is intercepted and not displayed in the console window; otherwise, the pressed key is displayed. - Depending on your application, you might want to use the method in conjunction with the property. + Depending on your application, you might want to use the method in conjunction with the property. The method reads from the keyboard even if the standard input is redirected to a file with the method. @@ -3099,11 +3099,11 @@ This method can be used to reacquire the standard output stream after it has bee ReadLine1 < ReadLine1.txt ``` - A line is defined as a sequence of characters followed by a carriage return (hexadecimal 0x000d), a line feed (hexadecimal 0x000a), or the value of the property. The returned string does not contain the terminating character(s). By default, the method reads input from a 256-character input buffer. Because this includes the character(s), the method can read lines that contain up to 254 characters. To read longer lines, call the method. + A line is defined as a sequence of characters followed by a carriage return (hexadecimal 0x000d), a line feed (hexadecimal 0x000a), or the value of the property. The returned string does not contain the terminating character(s). By default, the method reads input from a 256-character input buffer. Because this includes the character(s), the method can read lines that contain up to 254 characters. To read longer lines, call the method. - The method executes synchronously. That is, it blocks until a line is read or the Ctrl+Z keyboard combination (followed by Enter on Windows), is pressed. The property returns a object that represents the standard input stream and that has both a synchronous method and an asynchronous method. However, when used as the console's standard input stream, the executes synchronously rather than asynchronously and returns a `Task` only after the read operation has completed. + The method executes synchronously. That is, it blocks until a line is read or the Ctrl+Z keyboard combination (followed by Enter on Windows), is pressed. The property returns a object that represents the standard input stream and that has both a synchronous method and an asynchronous method. However, when used as the console's standard input stream, the executes synchronously rather than asynchronously and returns a `Task` only after the read operation has completed. - If this method throws an exception, the reader's position in the underlying object is advanced by the number of characters the method was able to read, but the characters already read into the internal buffer are discarded. Since the position of the reader in the stream cannot be changed, the characters already read are unrecoverable, and can be accessed only by reinitializing the . If the initial position within the stream is unknown or the stream does not support seeking, the underlying also needs to be reinitialized. To avoid such a situation and to produce robust code, you should use the property and method and store the read characters in a pre-allocated buffer. + If this method throws an exception, the reader's position in the underlying object is advanced by the number of characters the method was able to read, but the characters already read into the internal buffer are discarded. Since the position of the reader in the stream cannot be changed, the characters already read are unrecoverable, and can be accessed only by reinitializing the . If the initial position within the stream is unknown or the stream does not support seeking, the underlying also needs to be reinitialized. To avoid such a situation and to produce robust code, you should use the property and method and store the read characters in a pre-allocated buffer. If the Ctrl+Z key combination (followed by Enter on Windows) is pressed when the method is reading input from the console, the method returns `null`. This enables the user to prevent further keyboard input when the method is called in a loop. The following example illustrates this scenario. @@ -3447,7 +3447,7 @@ This method can be used to reacquire the standard output stream after it has bee property is set to the standard error output stream. + By default, the property is set to the standard error output stream. A that encapsulates a can be used to send error messages to a file. @@ -3538,7 +3538,7 @@ This method can be used to reacquire the standard output stream after it has bee property is set to the standard input stream. + By default, the property is set to the standard input stream. A that encapsulates a can be used to receive input from a file. @@ -3613,7 +3613,7 @@ This method can be used to reacquire the standard output stream after it has bee property is set to the standard output stream. + By default, the property is set to the standard output stream. A that encapsulates a can be used to send output to a file. For example: @@ -3899,7 +3899,7 @@ This method can be used to reacquire the standard output stream after it has bee property. The example displays the current title of the operating system window, waits for a key press, then displays a new title. + This example demonstrates the property. The example displays the current title of the operating system window, waits for a key press, then displays a new title. :::code language="csharp" source="~/snippets/csharp/System/Console/Title/mytitle.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.title/FS/mytitle.fs" id="Snippet1"::: @@ -3984,7 +3984,7 @@ This method can be used to reacquire the standard output stream after it has bee property is `false` and Ctrl+C is pressed, the pressed keys are not stored in the input buffer and the operating system terminates the currently executing process. This is the default value. + If the value of the property is `false` and Ctrl+C is pressed, the pressed keys are not stored in the input buffer and the operating system terminates the currently executing process. This is the default value. > [!CAUTION] > Use this property judiciously because setting it to `true` has such a dramatic effect. Most users expect Ctrl+C to terminate a console application. If you disable the effect of Ctrl+C, the user must remember to use Ctrl+Break to terminate the application, which is a less familiar key combination. @@ -3992,7 +3992,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The following example demonstrates the property. + The following example demonstrates the property. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1"::: @@ -4095,7 +4095,7 @@ This method can be used to reacquire the standard output stream after it has bee property when output is redirected throws either an or an exception. To prevent an exception, you can set the value of this property only if the property returns `false`. + Attempting to set the value of the property when output is redirected throws either an or an exception. To prevent an exception, you can set the value of this property only if the property returns `false`. @@ -4180,18 +4180,18 @@ This method can be used to reacquire the standard output stream after it has bee and properties. The dimensions of the console area are defined by the and properties. The property determines which column of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . + The console represents a rectangular window into a larger rectangular buffer area. Both the window and the buffer are measured vertically by their number of rows and horizontally by their number of columns. The dimensions of the buffer area are defined by the and properties. The dimensions of the console area are defined by the and properties. The property determines which column of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . - When a console window first opens, the default value of the property is zero, which indicates that the first column shown by the console corresponds to the first column (the column at position zero) in the buffer area. The default width of both the console window and the buffer area is 80 columns. This means that the property can be modified only if the console window is made narrower or the buffer area is made wider. + When a console window first opens, the default value of the property is zero, which indicates that the first column shown by the console corresponds to the first column (the column at position zero) in the buffer area. The default width of both the console window and the buffer area is 80 columns. This means that the property can be modified only if the console window is made narrower or the buffer area is made wider. - Note that if the width of the buffer area exceeds the width of the console window, the value of the property is automatically adjusted when the user uses the horizontal scroll bar to define the window's relationship to the buffer area. + Note that if the width of the buffer area exceeds the width of the console window, the value of the property is automatically adjusted when the user uses the horizontal scroll bar to define the window's relationship to the buffer area. - Attempting to set the value of the property when output is redirected throws an exception. To prevent the exception, you can set the value of this property only if the property returns `false`. + Attempting to set the value of the property when output is redirected throws an exception. To prevent the exception, you can set the value of this property only if the property returns `false`. ## Examples - The following example opens an 80-column console window and defines a buffer area that is 120 columns wide. It displays information on window and buffer size, and then waits for the user to press either the LEFT ARROW key or the RIGHT ARROW key. In the former case, it decrements the value of the property by one if the result is a legal value. In the latter case, it increases the value of the property by one if the result would be legal. Note that the example does not have to handle an , because it checks that the value to be assigned to the property is not negative and does not cause the sum of the and properties to exceed the property value. + The following example opens an 80-column console window and defines a buffer area that is 120 columns wide. It displays information on window and buffer size, and then waits for the user to press either the LEFT ARROW key or the RIGHT ARROW key. In the former case, it decrements the value of the property by one if the result is a legal value. In the latter case, it increases the value of the property by one if the result would be legal. Note that the example does not have to handle an , because it checks that the value to be assigned to the property is not negative and does not cause the sum of the and properties to exceed the property value. :::code language="csharp" source="~/snippets/csharp/System/Console/WindowLeft/windowleft1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.windowleft/fs/windowleft1.fs" id="Snippet1"::: @@ -4265,9 +4265,9 @@ This method can be used to reacquire the standard output stream after it has bee and properties. The dimensions of the console area are defined by the and properties. The property determines which row of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . + The console represents a rectangular window into a larger rectangular buffer area. Both the window and the buffer are measured vertically by their number of rows and horizontally by their number of columns. The dimensions of the buffer area are defined by the and properties. The dimensions of the console area are defined by the and properties. The property determines which row of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . - Attempting to set the value of the property when output is redirected throws an exception. To prevent the exception, you can set the value of this property only if the property returns `false`. + Attempting to set the value of the property when output is redirected throws an exception. To prevent the exception, you can set the value of this property only if the property returns `false`. @@ -4378,7 +4378,7 @@ This method can be used to reacquire the standard output stream after it has bee property when output is redirected throws either an or an exception. To prevent an exception, you can set the value of this property only if the property returns `false`. + Attempting to set the value of the property when output is redirected throws either an or an exception. To prevent an exception, you can set the value of this property only if the property returns `false`. @@ -5908,7 +5908,7 @@ This method can be used to reacquire the standard output stream after it has bee property of the property to another string. + The default line terminator is a string whose value is a carriage return followed by a line feed ("\r\n" in C#, or `vbCrLf` in Visual Basic). You can change the line terminator by setting the property of the property to another string. ]]> @@ -5958,7 +5958,7 @@ This method can be used to reacquire the standard output stream after it has bee property of the property to another string. The example provides an illustration. + The default line terminator is a string whose value is a carriage return followed by a line feed ("\r\n" in C#, or `vbCrLf` in Visual Basic). You can change the line terminator by setting the property of the property to another string. The example provides an illustration. diff --git a/xml/System/ConsoleCancelEventArgs.xml b/xml/System/ConsoleCancelEventArgs.xml index 125d112f7aa..90aaf9c6524 100644 --- a/xml/System/ConsoleCancelEventArgs.xml +++ b/xml/System/ConsoleCancelEventArgs.xml @@ -58,7 +58,7 @@ ## Remarks A user can interrupt a console application process by simultaneously pressing the modifier key and the console key (Ctrl+C), or the modifier key and the Break console key (Ctrl+Break). Consequently, .NET provides a object to the event handler for the event to specify whether the process should be cancelled. - If the property is set to `true` in the event handler, the process is resumed; otherwise, the process is terminated. By default, the value of the property is `false`, and the process terminates. + If the property is set to `true` in the event handler, the process is resumed; otherwise, the process is terminated. By default, the value of the property is `false`, and the process terminates. ## Examples The following example demonstrates how to use the class to handle an event. @@ -115,14 +115,14 @@ property is automatically initialized to `false` when the handler for the event is invoked. The value of the property when the event handler finishes determines whether the current process resumes or terminates. + The property is automatically initialized to `false` when the handler for the event is invoked. The value of the property when the event handler finishes determines whether the current process resumes or terminates. In a set operation after Ctrl+C is pressed, specify `true` to indicate that the current process should resume when the event handler concludes, or `false` to indicate that the current process should terminate. ## Examples - The following example demonstrates how to use the property to handle an event. + The following example demonstrates how to use the property to handle an event. :::code language="csharp" source="~/snippets/csharp/System/Console/CancelKeyPress/ckp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cancelkeypress/fs/ckp.fs" id="Snippet1"::: @@ -182,7 +182,7 @@ property to handle an event. + The following example demonstrates how to use the property to handle an event. :::code language="csharp" source="~/snippets/csharp/System/Console/CancelKeyPress/ckp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cancelkeypress/fs/ckp.fs" id="Snippet1"::: diff --git a/xml/System/ConsoleKeyInfo.xml b/xml/System/ConsoleKeyInfo.xml index 41648fef1db..ebbd5f9f9a5 100644 --- a/xml/System/ConsoleKeyInfo.xml +++ b/xml/System/ConsoleKeyInfo.xml @@ -395,7 +395,7 @@ property in a read operation. + The following example demonstrates using a property in a read operation. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1"::: @@ -448,12 +448,12 @@ property is \U0000. + If the key pressed does not map to a Unicode character (for example, if the user presses the **F1** key or the **Home** key), the value of the property is \U0000. ## Examples - The following example uses the property to add the characters input by the user into a string. The example ignores special keys other than **ENTER**, **ESC**, and **BACKSPACE**. + The following example uses the property to add the characters input by the user into a string. The example ignores special keys other than **ENTER**, **ESC**, and **BACKSPACE**. :::code language="csharp" source="~/snippets/csharp/System/ConsoleKeyInfo/KeyChar/keychar1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.consolekeyinfo.keychar/fs/keychar1.fs" id="Snippet1"::: @@ -506,7 +506,7 @@ property in a read operation. + The following example demonstrates using a property in a read operation. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rk.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey1/FS/rk.fs" id="Snippet1"::: diff --git a/xml/System/ConsoleSpecialKey.xml b/xml/System/ConsoleSpecialKey.xml index 2041b12e49e..bdd0a92dde2 100644 --- a/xml/System/ConsoleSpecialKey.xml +++ b/xml/System/ConsoleSpecialKey.xml @@ -55,7 +55,7 @@ property returns the enumeration type. + The property returns the enumeration type. Simultaneously pressing certain key combinations signals the operating system to interrupt the currently running process. The two valid key combinations are plus BREAK (CTRL+BREAK) and plus (Ctrl+C). diff --git a/xml/System/ContextMarshalException.xml b/xml/System/ContextMarshalException.xml index 993c5371e78..fa7fc577b2a 100644 --- a/xml/System/ContextMarshalException.xml +++ b/xml/System/ContextMarshalException.xml @@ -323,7 +323,7 @@ property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. + An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or `null` if the property does not supply the inner exception value to the constructor. The following table shows the initial property values for an instance of . diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index c6be1965faf..458a01949e6 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -206,7 +206,7 @@ property is initialized to . + The property is initialized to . For applications in which portability of date and time data or a limited degree of time zone awareness is important, you can use the corresponding constructor. @@ -401,7 +401,7 @@ ## Remarks This constructor interprets `year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. - The time of day for the resulting is midnight (00:00:00). The property is initialized to . + The time of day for the resulting is midnight (00:00:00). The property is initialized to . @@ -475,7 +475,7 @@ is midnight (00:00:00). The property is initialized to . + The time of day for the resulting is midnight (00:00:00). The property is initialized to . The allowable values for `year`, `month`, and `day` depend on `calendar`. An exception is thrown if the specified date and time cannot be expressed using `calendar`. @@ -567,7 +567,7 @@ property is initialized to . + The property is initialized to . This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. @@ -762,7 +762,7 @@ property is initialized to . + The property is initialized to . The allowable values for `year`, `month`, and `day` depend on `calendar`. An exception is thrown if the specified date and time cannot be expressed using `calendar`. @@ -870,7 +870,7 @@ ## Remarks This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. - The property is initialized to . + The property is initialized to . For applications in which portability of date and time data or a limited degree of time zone awareness is important, you can use the corresponding constructor. @@ -1076,7 +1076,7 @@ property is initialized to . + The property is initialized to . The allowable values for `year`, `month`, and `day` depend on `calendar`. An exception is thrown if the specified date and time cannot be expressed using `calendar`. @@ -1663,7 +1663,7 @@ For applications in which portability of date and time data or a limited degree The method takes into account leap years and the number of days in a month when performing date arithmetic. - This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. The property of the new instance is the same as that of the current instance. + This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. The property of the new instance is the same as that of the current instance. @@ -1805,7 +1805,7 @@ For applications in which portability of date and time data or a limited degree . Instead, it returns a new whose value is the result of this operation. The property of the returned object is the same as that of `value`. + This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. The property of the returned object is the same as that of `value`. The fractional part of `value` is the fractional part of an hour. For example, 4.5 is equivalent to 4 hours, 30 minutes, 0 seconds, 0 milliseconds, and 0 ticks. @@ -2372,7 +2372,7 @@ The value parameter is rounded to the nearest integer. method compares the property of `t1` and `t2` but ignores their property. Before comparing objects, ensure that the objects represent times in the same time zone. + To determine the relationship of `t1` to `t2`, the method compares the property of `t1` and `t2` but ignores their property. Before comparing objects, ensure that the objects represent times in the same time zone. @@ -2487,7 +2487,7 @@ The value parameter is rounded to the nearest integer. method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. + To determine the relationship of the current instance to `value`, the method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. This method implements the interface and performs slightly better than the method overload because it does not have to convert the `value` parameter to an object. @@ -2576,7 +2576,7 @@ The value parameter is rounded to the nearest integer. method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. + To determine the relationship of the current instance to `value`, the method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. Any instance of , regardless of its value, is considered greater than `null`. @@ -2650,14 +2650,14 @@ The value parameter is rounded to the nearest integer. property of the returned value is the same as that of the current instance. + The value of the property of the returned value is the same as that of the current instance. - Because the type represents both dates and times in a single type, it is important to avoid misinterpreting a date returned by the property as a date and time. + Because the type represents both dates and times in a single type, it is important to avoid misinterpreting a date returned by the property as a date and time. ## Examples - The following example uses the property to extract the date component of a value with its time component set to zero (or 0:00:00, or midnight). It also illustrates that, depending on the format string used when displaying the value, the time component can continue to appear in formatted output. + The following example uses the property to extract the date component of a value with its time component set to zero (or 0:00:00, or midnight). It also illustrates that, depending on the format string used when displaying the value, the time component can continue to appear in formatted output. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Date/Date1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Date/fs/Date1.fs" id="Snippet1"::: @@ -2714,20 +2714,20 @@ The value parameter is rounded to the nearest integer. property always returns the day of the month in the Gregorian calendar, even if the current value was instantiated using some other calendar or if the current culture's default calendar is not the Gregorian calendar. To retrieve the day of the month of a particular date using some other calendar, call that calendar's method. The following example uses both the property and the method to retrieve the day of the month for a value that is instantiated using the Hijri calendar. + The property always returns the day of the month in the Gregorian calendar, even if the current value was instantiated using some other calendar or if the current culture's default calendar is not the Gregorian calendar. To retrieve the day of the month of a particular date using some other calendar, call that calendar's method. The following example uses both the property and the method to retrieve the day of the month for a value that is instantiated using the Hijri calendar. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/Day1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Day/fs/Day1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/Day/Day1.vb" id="Snippet1"::: - Similarly, the following example uses both the property and the method to retrieve the day of the month when the current culture is ar-SA, which uses Hijri as its default calendar. + Similarly, the following example uses both the property and the method to retrieve the day of the month when the current culture is ar-SA, which uses Hijri as its default calendar. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/Day2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Day/fs/Day2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/Day/Day2.vb" id="Snippet2"::: ## Examples - The following example demonstrates the property. + The following example demonstrates the property. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/class1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Minute etc/FS/class1.fs" id="Snippet1"::: @@ -2792,12 +2792,12 @@ The value parameter is rounded to the nearest integer. ## Remarks The value of the constants in the enumeration ranges from to . If cast to an integer, its value ranges from zero (which indicates ) to six (which indicates ). - The property returns an enumerated constant; it does not reflect a system's regional and language settings. To retrieve a string representing a localized weekday name for a particular date, call one of the overloads of the method that includes a `format` parameter and pass it either the `ddd` or `dddd` custom format strings. For details, see [How to: Extract the Day of the Week from a Specific Date](/dotnet/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date). + The property returns an enumerated constant; it does not reflect a system's regional and language settings. To retrieve a string representing a localized weekday name for a particular date, call one of the overloads of the method that includes a `format` parameter and pass it either the `ddd` or `dddd` custom format strings. For details, see [How to: Extract the Day of the Week from a Specific Date](/dotnet/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date). ## Examples - The following example demonstrates the property and the enumeration. + The following example demonstrates the property and the enumeration. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.DayOfWeek/FS/dow.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/DayOfWeek/dow.cs" id="Snippet1"::: @@ -2856,7 +2856,7 @@ The value parameter is rounded to the nearest integer. property takes leap years into account when it calculates the day of the year. The property value always reflects the day of the year in the Gregorian calendar, regardless of the current culture's current calendar. To retrieve the day of the year in a different calendar, call the method of that calendar. + The property takes leap years into account when it calculates the day of the year. The property value always reflects the day of the year in the Gregorian calendar, regardless of the current culture's current calendar. To retrieve the day of the year in a different calendar, call the method of that calendar. ## Examples The following example displays the day of the year of December 31 for the years 2010-2020 in the Gregorian calendar. Note that the example shows that December 31 is the 366th day of the year in leap years. @@ -3103,7 +3103,7 @@ The value parameter is rounded to the nearest integer. property values are equal. Their property values are not considered in the test for equality. + The current instance and `value` are equal if their property values are equal. Their property values are not considered in the test for equality. This method implements the interface, and performs slightly better than the method because the `value` parameter does not have to be converted to an object. @@ -3181,7 +3181,7 @@ The value parameter is rounded to the nearest integer. property values are equal. Their property values are not considered in the test for equality. + The current instance and `value` are equal if their property values are equal. Their property values are not considered in the test for equality. @@ -3252,7 +3252,7 @@ The value parameter is rounded to the nearest integer. property values are equal. Their property values are not considered in the test for equality. + `t1` and `t2` are equal if their property values are equal. Their property values are not considered in the test for equality. @@ -3377,7 +3377,7 @@ The value parameter is rounded to the nearest integer. The `fileTime` parameter specifies a file time expressed in 100-nanosecond ticks. - Starting with the .NET Framework version 2.0, the return value is a whose property is . + Starting with the .NET Framework version 2.0, the return value is a whose property is . @@ -3464,7 +3464,7 @@ The value parameter is rounded to the nearest integer. The `fileTime` parameter specifies a file time expressed in 100-nanosecond ticks. - Starting with the .NET Framework version 2.0, the return value is a whose property is . + Starting with the .NET Framework version 2.0, the return value is a whose property is . ]]> @@ -4270,7 +4270,7 @@ juillet 2009 property is always expressed using a 24-hour clock. To retrieve a string that represents the hour of a date and time using a 12-hour clock, call the or method with the "h" custom format specifier. For example: + The value of the property is always expressed using a 24-hour clock. To retrieve a string that represents the hour of a date and time using a 12-hour clock, call the or method with the "h" custom format specifier. For example: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Hour/Hour1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Hour/fs/Hour1.fs" id="Snippet1"::: @@ -4279,7 +4279,7 @@ juillet 2009 ## Examples - The following example demonstrates the property. + The following example demonstrates the property. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/class1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Minute etc/FS/class1.fs" id="Snippet1"::: @@ -4337,7 +4337,7 @@ juillet 2009 value falls within the daylight saving time range of the local time zone, which is returned by the property. You can determine whether a time zone supports daylight saving time by retrieving the value of its property. For time zones that observe daylight saving time, you can determine when the transition to and from daylight saving time occurs by retrieving the array returned by the time zone's property. + This method determines whether the current value falls within the daylight saving time range of the local time zone, which is returned by the property. You can determine whether a time zone supports daylight saving time by retrieving the value of its property. For time zones that observe daylight saving time, you can determine when the transition to and from daylight saving time occurs by retrieving the array returned by the time zone's property. If the current value represents either an ambiguous or an invalid time in the local time zone, the method returns `false`. @@ -4471,14 +4471,14 @@ juillet 2009 property of a new value to a particular value by calling the method. + You can explicitly set the property of a new value to a particular value by calling the method. - The property allows a value to clearly reflect either Coordinated Universal Time (UTC) or the local time. In contrast, the structure can unambiguously reflect any time in any time zone as a single point in time. + The property allows a value to clearly reflect either Coordinated Universal Time (UTC) or the local time. In contrast, the structure can unambiguously reflect any time in any time zone as a single point in time. ## Examples - The following example uses the method to demonstrate how the property influences the and conversion methods. + The following example uses the method to demonstrate how the property influences the and conversion methods. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Kind_Suite/fs/ks.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Kind/ks.cs" id="Snippet1"::: @@ -4637,7 +4637,7 @@ juillet 2009 property by using the "fff" format specifier. For example, the following code displays a string that contains the number of milliseconds in a date and time to the console. + You can display the string representation of the property by using the "fff" format specifier. For example, the following code displays a string that contains the number of milliseconds in a date and time to the console. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Millisecond/Millisecond.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Millisecond/fs/Millisecond.fs" id="Snippet1"::: @@ -4658,7 +4658,7 @@ juillet 2009 ## Examples - The following example demonstrates the property. + The following example demonstrates the property. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/class1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Minute etc/FS/class1.fs" id="Snippet1"::: @@ -4721,7 +4721,7 @@ juillet 2009 property. + The following example demonstrates the property. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/class1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Minute etc/FS/class1.fs" id="Snippet1"::: @@ -4847,7 +4847,7 @@ juillet 2009 property. + The following example demonstrates the property. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/class1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Minute etc/FS/class1.fs" id="Snippet1"::: @@ -4935,20 +4935,20 @@ juillet 2009 property returns a value that represents the current date and time on the local computer. Note that there is a difference between a value, which represents the number of ticks that have elapsed since midnight of January 1, 0001, and the string representation of that value, which expresses a date and time value in a culture-specific-specific format. For information on formatting date and time values, see the method. The following example displays the short date and time string in a number of culture-specific formats. + The property returns a value that represents the current date and time on the local computer. Note that there is a difference between a value, which represents the number of ticks that have elapsed since midnight of January 1, 0001, and the string representation of that value, which expresses a date and time value in a culture-specific-specific format. For information on formatting date and time values, see the method. The following example displays the short date and time string in a number of culture-specific formats. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Now/now1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.now/fs/now1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/Now/now1.vb" id="Snippet2"::: - The resolution of this property depends on the system timer, which depends on the underlying operating system. It tends to be between 0.5 and 15 milliseconds. As a result, repeated calls to the property in a short time interval, such as in a loop, may return the same value. + The resolution of this property depends on the system timer, which depends on the underlying operating system. It tends to be between 0.5 and 15 milliseconds. As a result, repeated calls to the property in a short time interval, such as in a loop, may return the same value. - The property is frequently used to measure performance. However, because of its low resolution, it is not suitable for use as a benchmarking tool. A better alternative is to use the class. + The property is frequently used to measure performance. However, because of its low resolution, it is not suitable for use as a benchmarking tool. A better alternative is to use the class. - Starting with the .NET Framework version 2.0, the return value is a whose property returns . + Starting with the .NET Framework version 2.0, the return value is a whose property returns . > [!NOTE] -> You can also use the property to retrieve the current local date and time. It allows a local time to be expressed unambiguously as a single point in time, which in turn makes that time value portable across computers. +> You can also use the property to retrieve the current local date and time. It allows a local time to be expressed unambiguously as a single point in time, which in turn makes that time value portable across computers. @@ -5093,7 +5093,7 @@ juillet 2009 operator determines whether two values are equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines whether two values are equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. The equivalent method for this operator is @@ -5169,7 +5169,7 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. The equivalent method for this operator is ]]> @@ -5237,7 +5237,7 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. The equivalent method for this operator is ]]> @@ -5305,7 +5305,7 @@ juillet 2009 operator determines whether two values are not equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines whether two values are not equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. The equivalent method for this operator is ]]> @@ -5372,7 +5372,7 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. The equivalent method for this operator is ]]> @@ -5440,7 +5440,7 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. The equivalent method for this operator is ]]> @@ -5521,7 +5521,7 @@ juillet 2009 method does not consider the value of the property of the two values when performing the subtraction. Before subtracting objects, ensure that the objects represent times in the same time zone. Otherwise, the result will include the difference between time zones. + The method does not consider the value of the property of the two values when performing the subtraction. Before subtracting objects, ensure that the objects represent times in the same time zone. Otherwise, the result will include the difference between time zones. > [!NOTE] > The method does consider the difference between time zones when performing the subtraction. @@ -5703,13 +5703,13 @@ The following example parses strings in each of these formats by using the forma |If you call|And `provider` is|Formatting information is derived from| |-----------------|-----------------------|--------------------------------------------| -||-|The current culture ( property)| +||-|The current culture ( property)| | or |a object|The specified object| -| or |`null`|The current culture ( property)| -| or |a object|The property| +| or |`null`|The current culture ( property)| +| or |a object|The property| | or |Custom implementation|The method| - When formatting information is derived from a object, the property defines the calendar used in the parsing operation. + When formatting information is derived from a object, the property defines the calendar used in the parsing operation. If you parse a date and time string by using a object with customized settings that are different from those of a standard culture, use the method instead of the method to improve the chances for a successful conversion. A non-standard date and time string can be complicated and difficult to parse. The method tries to parse a string with several implicit parse patterns, all of which might fail. In contrast, the method requires you to explicitly designate one or more exact parse patterns that are likely to succeed. For more information, see the "DateTimeFormatInfo and Dynamic Data" section in the topic. @@ -5732,15 +5732,15 @@ The following example parses strings in each of these formats by using the forma |DateTimeStyles member|Effect on conversion| |---------------------------|--------------------------| -||Parses `s` and, if necessary, converts it to UTC, as follows:

- If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to .
- If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to .
- In all other cases, the flag has no effect.| +||Parses `s` and, if necessary, converts it to UTC, as follows:

- If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to .
- If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to .
- In all other cases, the flag has no effect.| ||This value is ignored. Inner white space is always permitted in the date and time elements of `s`.| ||This value is ignored. Leading white space is always permitted in the date and time elements of `s`.| ||This value is ignored. Trailing white space is always permitted in the date and time elements of `s`.| ||Specifies that `s` may contain leading, inner, and trailing white spaces. This is the default behavior. It cannot be overridden by supplying a more restrictive enumeration value such as .| -||Specifies that if `s` lacks any time zone information, local time is assumed. Unless the flag is present, the property of the returned value is set to .| -||Specifies that if `s` lacks any time zone information, UTC is assumed. Unless the flag is present, the method converts the returned value from UTC to local time and sets its property to .| +||Specifies that if `s` lacks any time zone information, local time is assumed. Unless the flag is present, the property of the returned value is set to .| +||Specifies that if `s` lacks any time zone information, UTC is assumed. Unless the flag is present, the method converts the returned value from UTC to local time and sets its property to .| ||Although valid, this value is ignored.| -||For strings that contain time zone information, tries to prevent the conversion of a date and time string to a value that represents a local time with its property set to . Typically, such a string is created by calling the method and by using the "o", "r", or "u" standard format specifier.| +||For strings that contain time zone information, tries to prevent the conversion of a date and time string to a value that represents a local time with its property set to . Typically, such a string is created by calling the method and by using the "o", "r", or "u" standard format specifier.| ### The return value and DateTime.Kind @@ -5751,7 +5751,7 @@ The `DateTime.Parse` overloads return a value whose ). - The time in an unknown time zone (). - Generally, the method returns a object whose property is . However, the method may also perform time zone conversion and set the value of the property differently, depending on the values of the `s` and `styles` parameters: + Generally, the method returns a object whose property is . However, the method may also perform time zone conversion and set the value of the property differently, depending on the values of the `s` and `styles` parameters: |If|Time zone conversion|Kind property| |--------|--------------------------|-------------------| @@ -5765,7 +5765,7 @@ The `DateTime.Parse` overloads return a value whose property during a formatting and parsing operation by using the flag. The following example illustrates how the flag affects the parsing operation on values that are converted to strings by using the "o", "r", or "u" format specifier. + You can also preserve the value of a date and time's property during a formatting and parsing operation by using the flag. The following example illustrates how the flag affects the parsing operation on values that are converted to strings by using the "o", "r", or "u" format specifier. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Parse/Parse5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Parse/fs/Parse5.fs" id="Snippet5"::: @@ -5841,7 +5841,7 @@ You can also download a complete set of `DateTime.Parse` examples, which are inc ## Remarks -If `s` contains time zone information, this method returns a value whose property is and converts the date and time in `s` to local time. Otherwise, it performs no time zone conversion and returns a value whose property is . +If `s` contains time zone information, this method returns a value whose property is and converts the date and time in `s` to local time. Otherwise, it performs no time zone conversion and returns a value whose property is . This overload attempts to parse `s` by using the formatting conventions of the current culture. The current culture is indicated by the property. To parse a string using the formatting conventions of a specific culture, call the or the overloads. @@ -5995,7 +5995,7 @@ It handles the exception that is thrown when the m ## Remarks -If `s` contains time zone information, this method returns a value whose property is and converts the date and time in `s` to local time. Otherwise, it performs no time zone conversion and returns a value whose property is . +If `s` contains time zone information, this method returns a value whose property is and converts the date and time in `s` to local time. Otherwise, it performs no time zone conversion and returns a value whose property is . This overload attempts to parse `s` by using the style. @@ -6146,7 +6146,7 @@ The following example parses an array of date strings by using the conventions o ## Remarks -This method overload converts the date and time in `s` and sets the property of the returned value as follows: +This method overload converts the date and time in `s` and sets the property of the returned value as follows: | If | Time zone conversion | Kind property | |----|----------------------|---------------| @@ -6157,7 +6157,7 @@ This method overload converts the date and time in `s` and sets the method and displays the value of the property of the resulting values. +The following example demonstrates the method and displays the value of the property of the resulting values. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Parse/Parse4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Parse/fs/Parse4.fs" id="Snippet4"::: @@ -6273,7 +6273,7 @@ The following example demonstrates the method parses the string representation of a date, which must be in the format defined by the `format` parameter. It also requires that the \ and \