diff --git a/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml b/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml index 0f518bcee74..30bb22f767b 100644 --- a/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml +++ b/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml @@ -111,7 +111,6 @@ ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -175,7 +174,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -245,7 +243,6 @@ foreach (UserPrincipal u in results) In an extended class, you might implement an advanced search filter for `LogonCount`: ```csharp - public class InetOrgPersonSearchFilter : AdvancedFilters { public InetOrgPersonSearchFilter(Principal p) : base(p) { } @@ -293,7 +290,6 @@ public class InetOrgPersonSearchFilter : AdvancedFilters ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -355,7 +351,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -419,7 +414,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -481,7 +475,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); diff --git a/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml b/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml index 6137fa93a2c..bddab95c1a8 100644 --- a/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml +++ b/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml @@ -729,7 +729,7 @@ A search is performed for all authenticable principals under the container "DC=adamApp1,DC=fabrikam,DC=com" that have not logged on to this ADAM instance for the last 45 days. The principals returned by the search are then deleted. -``` +```csharp PrincipalContext ctx = new PrincipalContext( ContextType.ApplicationDirectory, "adamHost1.fabrikam.com:5000", @@ -748,7 +748,6 @@ foreach (Principal p in oldPrincipals) oldPrincipals.Dispose(); ctx.Dispose(); - ``` ]]> @@ -1280,9 +1279,9 @@ ctx.Dispose(); ## Examples The following example code connects to the LDAP domain "fabrikam.com" with the username (administrator) and password (SecretPwd123) initialized in the constructor. - A search is performed to find the user with name "John Smith" under the container specified in the constructor: "CN=Users,DC=fabrikam,DC=com." If the user is found, a check is performed to determine whether this user's account has been locked out. If the account has been locked out, the code example unlocks the account. + A search is performed to find the user with name "John Smith" under the container specified in the constructor: "CN=Users,DC=fabrikam,DC=com." If the user is found, a check is performed to determine whether this user's account has been locked out. If the account has been locked out, the code example unlocks the account. -``` +```csharp PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", diff --git a/xml/System.DirectoryServices/DirectoryEntry.xml b/xml/System.DirectoryServices/DirectoryEntry.xml index 1033ae1a90f..89b3f3a102d 100644 --- a/xml/System.DirectoryServices/DirectoryEntry.xml +++ b/xml/System.DirectoryServices/DirectoryEntry.xml @@ -2069,7 +2069,6 @@ if (string.Compare(mySchemaEntry.Name,"container") == 0) foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children) Console.WriteLine(myChildDirectoryEntry.Path); } - ``` ```cpp diff --git a/xml/System.EnterpriseServices/ServicedComponent.xml b/xml/System.EnterpriseServices/ServicedComponent.xml index f148d25275f..bf1aa4ffd84 100644 --- a/xml/System.EnterpriseServices/ServicedComponent.xml +++ b/xml/System.EnterpriseServices/ServicedComponent.xml @@ -52,7 +52,7 @@ To deploy this class as a configured COM component, you must generate a strong key, compile the class as a library, and register the library. These three steps are accomplished by the following three commands. -``` +```console sn -k Calculator.snk csc /t:library Calculator.cs regsvcs Calculator.dll diff --git a/xml/System.Messaging/DefaultPropertiesToSend.xml b/xml/System.Messaging/DefaultPropertiesToSend.xml index fd1d8929dcf..79afe37949b 100644 --- a/xml/System.Messaging/DefaultPropertiesToSend.xml +++ b/xml/System.Messaging/DefaultPropertiesToSend.xml @@ -72,7 +72,7 @@ There are two ways to define a queue's default properties to send, as shown in the following C# code. You can set values for this instance of and associate it with the queue's property: -``` +```csharp DefaultPropertiesToSend myDefaultProperties = new DefaultPropertiesToSend(); // Set default values for the properties. myDefaultProperties.Label = "myLabel"; @@ -84,7 +84,7 @@ DefaultPropertiesToSend myDefaultProperties = new DefaultPropertiesToSend(); Or, you can individually assign values to the instance's property directly: -``` +```csharp myMessageQueue.DefaultPropertiesToSend.Label = "myLabel"; myMessageQueue.DefaultPropertiesToSend.Recoverable = false; ... diff --git a/xml/System.Messaging/Message.xml b/xml/System.Messaging/Message.xml index 2f01ef38a4d..9c683de7e48 100644 --- a/xml/System.Messaging/Message.xml +++ b/xml/System.Messaging/Message.xml @@ -1040,7 +1040,7 @@ Other formatters can provide binding functionality also, as shown in the following C# code. -``` +```csharp message.Formatter = new ActiveXMessageFormatter(); object myObject message.Body; if (myObject is string) { diff --git a/xml/System.Messaging/MessageQueue.xml b/xml/System.Messaging/MessageQueue.xml index 20216db0c75..17189409160 100644 --- a/xml/System.Messaging/MessageQueue.xml +++ b/xml/System.Messaging/MessageQueue.xml @@ -4117,13 +4117,8 @@ The name of the computer is not valid, possibly because the syntax is incorrect. System.String - Introduced in MSMQ 3.0. Gets or sets the multicast address associated with the queue. - A that contains a valid multicast address (in the form shown below) or , which indicates that the queue is not associated with a multicast address. - -``` -<address>:<port> -``` - + Gets or sets the multicast address associated with the queue. + A valid multicast address (in the form <address>:<port>) or , which indicates that the queue is not associated with a multicast address. .",typeof(baseName).Assembly); ``` diff --git a/xml/System.Resources/ResXResourceReader.xml b/xml/System.Resources/ResXResourceReader.xml index 09e646cbaa5..21ebbb29181 100644 --- a/xml/System.Resources/ResXResourceReader.xml +++ b/xml/System.Resources/ResXResourceReader.xml @@ -988,7 +988,7 @@ The resource XML file used by the example contains one data node and one metadata node. To use the XML file with the previous example, copy the following text and save it to a file named Resource1.resx. -``` +```xml diff --git a/xml/System.Resources/ResourceManager.xml b/xml/System.Resources/ResourceManager.xml index bd835b7b6f8..971d88f891c 100644 --- a/xml/System.Resources/ResourceManager.xml +++ b/xml/System.Resources/ResourceManager.xml @@ -893,10 +893,9 @@ ## Examples - The following example calls the method to retrieve culture-specific resources for the French (France) culture. It then enumerates all of the resources in the resource set. It contains the source code for an executable named ShowNumbers.exe. It also includes the following two text file that contain the names of numbers. The first, NumberResources.txt, contains the names of numbers from one to ten in the English language: - -``` + The following example calls the method to retrieve culture-specific resources for the French (France) culture. It then enumerates all of the resources in the resource set. It contains the source code for an executable named ShowNumbers.exe. The example includes two text files that contain the names of numbers. The first, NumberResources.txt, contains the names of numbers from one to ten in the English language: +```txt one=one two=two three=three @@ -907,24 +906,20 @@ seven=seven eight=eight nine=nine ten=ten - ``` The second, NumberResources.fr-FR.txt, contains the names of numbers from one to four in the French language: -``` - +```txt one=un two=deux three=trois four=quatre - ``` You can use a batch file to generate the resource files, embed the English language resource file into the executable, and create a satellite assembly for the French language resources. Here's the batch file to generate an executable by using the Visual Basic compiler: -``` - +```bat resgen NumberResources.txt vbc shownumbers.vb /resource:NumberResources.resources @@ -935,21 +930,19 @@ al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr For the C# compiler, you can use the following batch file: -``` - +```bat resgen NumberResources.txt csc shownumbers.cs /resource:NumberResources.resources md fr-FR resgen NumberResources.fr-FR.txt al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr-FR.resources - ``` :::code language="csharp" source="~/snippets/csharp/System.Resources/ResourceManager/GetResourceSet/shownumbers.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.resources.resourcemanager.getresourceset/vb/shownumbers.vb" id="Snippet1"::: - Note that if you change the value of the `createIfNotExists` argument to `false`, the method call returns `null`, since Resource Manager has not already loaded the French language resources. +If you change the value of the `createIfNotExists` argument to `false`, the method call returns `null`, since Resource Manager hasn't yet loaded the French language resources. ]]> @@ -1128,15 +1121,13 @@ al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr You can use the following batch file to build the C# example. For Visual Basic, change `csc` to `vbc`, and change the extension of the source code file from `.cs` to `.vb`. -``` - +```bat csc CreateResources.cs CreateResources resgen AppResources.resx csc GetStream.cs /resource:AppResources.resources - ``` ]]> diff --git a/xml/System.Resources/ResourceReader.xml b/xml/System.Resources/ResourceReader.xml index f518a152fd7..f428932badb 100644 --- a/xml/System.Resources/ResourceReader.xml +++ b/xml/System.Resources/ResourceReader.xml @@ -174,10 +174,10 @@ [!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] ## Examples - The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. -``` +The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. +```txt Title="Top Pet Animal Clinic" Label1="Patient Number:" Label2="Pet Name:" @@ -190,25 +190,24 @@ Label8="Address:" Label9="Home Phone:" Label10="Work Phone:" Label11="Mobile Phone:" - ``` You can compile the .txt file into a .resources file by issuing the following command: - **resgen PatientForm.txt** +`resgen PatientForm.txt` The following example assumes that the resource file is embedded in the assembly that contains the application's executable code. It retrieves a resource file named `PatientForm.resources` from the currently executing assemblies and displays the name and value of each of its resources. :::code language="csharp" source="~/snippets/csharp/System.Resources/ResourceReader/.ctor/stream1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.resources.resourcereader.ctor/vb/stream1.vb" id="Snippet1"::: - If the C# example is named `Example.cs`, you can compile it by using the following command: +If the C# example is named `Example.cs`, you can compile it by using the following command: - **csc Example.cs /res:PatientForm.resources** +`csc Example.cs /res:PatientForm.resources` - If the Visual Basic example is named `Example.vb`, you can compile it by using the following command: +If the Visual Basic example is named `Example.vb`, you can compile it by using the following command: - **vbc Example.vb /res:PatientForm.resources** +`vbc Example.vb /res:PatientForm.resources` ]]> @@ -279,8 +278,7 @@ Label11="Mobile Phone:" ## Examples The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. -``` - +```txt Title="Top Pet Animal Clinic" Label1="Patient Number:" Label2="Pet Name:" @@ -293,12 +291,11 @@ Label8="Address:" Label9="Home Phone:" Label10="Work Phone:" Label11="Mobile Phone:" - ``` You can compile this .txt file into a .resources file by issuing the following command: - **resgen PatientForm.txt** +`resgen PatientForm.txt` The following example enumerates the resources in `PatientForm.resources` and displays the name and value of each. @@ -514,15 +511,12 @@ Label11="Mobile Phone:" You can handle the exception by calling the method to retrieve information about the data type and the byte array assigned to the named resource. For more information, see the "Retrieving Resources by Name with GetResourceData" section in the class topic. > [!IMPORTANT] -> The class includes two methods that return enumerators. The method returns an interface object and is the recommended method to call when enumerating resources. - - +> The class includes two methods that return enumerators. The method returns an interface object and is the recommended method to call when enumerating resources. ## Examples The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. -``` - +```txt Title="Top Pet Animal Clinic" Label1="Patient Number:" Label2="Pet Name:" @@ -535,12 +529,11 @@ Label8="Address:" Label9="Home Phone:" Label10="Work Phone:" Label11="Mobile Phone:" - ``` You can compile the .txt file into a .resources file by issuing the following command: - **resgen PatientForm.txt** +`resgen PatientForm.txt` The following example enumerates the resources in `PatientForm.resources` and displays the name and value of each.