Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions xml/System.CodeDom/CodeTypeReference.xml
Original file line number Diff line number Diff line change
Expand Up @@ -555,27 +555,27 @@ System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Gen

- The <xref:System.CodeDom.CodeTypeReference.BaseType> property for the parent <xref:System.CodeDom.CodeTypeReference> returns the following:

```
```
System.Collections.Generic.Dictionary`2
```
```

- The <xref:System.CodeDom.CodeTypeReference.BaseType> property for the first <xref:System.CodeDom.CodeTypeReference> object in the <xref:System.CodeDom.CodeTypeReference.TypeArguments*> collection returns the following:

```
```
System.String
```
```

- The <xref:System.CodeDom.CodeTypeReference.BaseType> property for the second <xref:System.CodeDom.CodeTypeReference> object in the <xref:System.CodeDom.CodeTypeReference.TypeArguments*> collection returns the following:

```
```
System.Collections.Generic.List`1
```
```

- The <xref:System.CodeDom.CodeTypeReference.TypeArguments> property in the <xref:System.CodeDom.CodeTypeReference> object for ``System.Collections.Generic.List`1`` returns the following:

```
```
System.Int32
```
```

The type argument count should be used when parsing the associated <xref:System.CodeDom.CodeTypeReference.TypeArguments*> values. The common practice is to remove the type argument count from the generated code, but the practice is compiler specific. It is important to note that the type argument count can be found within a nested type name, in which case it is followed by a plus sign ("+").

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ Do not modify the underlying collection directly. Use <xref:System.Collections.C
For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).

> [!NOTE]
> Always call `Dispose` before you release your last reference to the <xref:System.Collections.Concurrent.BlockingCollection`1>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Collections.Concurrent.BlockingCollection`1> object's `Finalize` method.
> Always call `Dispose` before you release your last reference to the <xref:System.Collections.Concurrent.BlockingCollection`1>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Collections.Concurrent.BlockingCollection`1> object's `Finalize` method.

]]></format>
</remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@

- Applies the <xref:System.ComponentModel.DataAnnotations.DisplayColumnAttribute> attribute to the `Address` metadata partial class to specify the following:

- The City column from the Address table (the parent table) is displayed as the foreign-key column in the CustomerAddress child table.
- The City column from the Address table (the parent table) is displayed as the foreign-key column in the CustomerAddress child table.

- The PostalCode column from the Address table (the parent table) is used for sorting the Address selection box in the CustomerAddress child table.
- The PostalCode column from the Address table (the parent table) is used for sorting the Address selection box in the CustomerAddress child table.

- The sort order is set to ascending.
- The sort order is set to ascending.

The example applies the <xref:System.ComponentModel.DataAnnotations.DisplayColumnAttribute> attribute to the `Customer` metadata partial class to specify that the LastName column in displayed as the foreign-key column for the CustomerAddress table.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ The following example shows how to use the <xref:System.ComponentModel.DataAnnot

- In the associated metadata class, it applies the <xref:System.ComponentModel.DataAnnotations.DisplayFormatAttribute> attribute to specify the following results:

- Display the text "[Null]" when a data field is empty.
- Display currency data in locale specific currency format.
- Display date information in short format (mm/dd/yy). This format also applies in edit mode.
- Display the text "[Null]" when a data field is empty.
- Display currency data in locale specific currency format.
- Display date information in short format (mm/dd/yy). This format also applies in edit mode.

:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/CS/product.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/VB/product.vb" id="Snippet1":::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@

- In the associated metadata class, it applies the <xref:System.ComponentModel.DataAnnotations.RangeAttribute> attribute to obtain the following results:

- Apply the attribute to a data field of type integer.
- Apply the attribute to a data field of type integer.

- Apply the attribute to an integer data field and define a custom validation error message.
- Apply the attribute to an integer data field and define a custom validation error message.

- Apply the attribute to a `DateTime` data field and define a custom validation error message.
- Apply the attribute to a `DateTime` data field and define a custom validation error message.

:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/CS/Product.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/VB/Product.vb" id="Snippet1":::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@

- In the associated metadata class, it applies the <xref:System.ComponentModel.DataAnnotations.RequiredAttribute> attribute, which specifies the following requirements:

- The Title data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message. The error message is specified at the time that the attribute is applied to the data field.
- The Title data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message. The error message is specified at the time that the attribute is applied to the data field.

- The MiddleName data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message.
- The MiddleName data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message.

:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RequiredAttribute/CS/Customer.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RequiredAttribute/VB/Customer.vb" id="Snippet1":::
Expand Down
33 changes: 12 additions & 21 deletions xml/System.ComponentModel/BindingList`1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@

<xref:System.ComponentModel.BindingList`1> supports factory-created instances through the extensible <xref:System.ComponentModel.BindingList`1.AddNew*> method. (This same type of extensibility is also found in other classes, such as <xref:System.Windows.Forms.BindingSource>) In addition, since this class implements the <xref:System.ComponentModel.ICancelAddNew> interface, it enables transactional commits or rollbacks of the new item through the <xref:System.ComponentModel.BindingList`1.EndNew*> and <xref:System.ComponentModel.BindingList`1.CancelNew*> methods.



## Examples
The following code example demonstrates binding to a <xref:System.ComponentModel.BindingList`1> component containing a business object. This is a complete example that contains a `Main` method.

Expand Down Expand Up @@ -173,14 +171,12 @@
## Remarks
The following table shows initial property values for an instance of <xref:System.ComponentModel.BindingList`1> class.

|Property|Initial Value|
|--------------|-------------------|
|<xref:System.ComponentModel.BindingList`1.AllowEdit*>|`true`|
|<xref:System.ComponentModel.BindingList`1.AllowNew*>|`true` if the list type has a parameterless constructor; otherwise, `false`.|
|<xref:System.ComponentModel.BindingList`1.AllowRemove*>|`true`|
|<xref:System.ComponentModel.BindingList`1.RaiseListChangedEvents*>|`true`|


| Property | Initial Value |
|--------------------------------------------------------------------|---------------|
| <xref:System.ComponentModel.BindingList`1.AllowEdit*> | `true` |
| <xref:System.ComponentModel.BindingList`1.AllowNew*> | `true` if the list type has a parameterless constructor; otherwise, `false`. |
| <xref:System.ComponentModel.BindingList`1.AllowRemove*> | `true` |
| <xref:System.ComponentModel.BindingList`1.RaiseListChangedEvents*> | `true` |

## Examples
The following code example demonstrates how to construct a new <xref:System.ComponentModel.BindingList`1>. For the complete example, see the <xref:System.ComponentModel.BindingList`1> class overview topic.
Expand Down Expand Up @@ -302,8 +298,6 @@

For more information about supplying custom new item functionality, see the <xref:System.ComponentModel.BindingList`1.AddNew*> method. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/).



## Examples
The following code example demonstrates how to handle the <xref:System.ComponentModel.BindingList`1.AddingNew> event. For the complete example, see the <xref:System.ComponentModel.BindingList`1> class overview topic.

Expand Down Expand Up @@ -362,24 +356,21 @@
## Remarks
The <xref:System.ComponentModel.BindingList`1.AddNew*> method adds a new item to the collection represented by the <xref:System.Collections.ObjectModel.Collection`1.Items> property. To add a new item, the following logic is used:

1. The <xref:System.ComponentModel.BindingList`1.AddingNew> event is automatically raised.
1. The <xref:System.ComponentModel.BindingList`1.AddingNew> event is automatically raised.

This event can be programmatically handled to construct a new custom item. This is accomplished in the event handler by setting the <xref:System.ComponentModel.AddingNewEventArgs.NewObject> property of the <xref:System.ComponentModel.AddingNewEventArgs> parameter to the new item.
This event can be programmatically handled to construct a new custom item. This is accomplished in the event handler by setting the <xref:System.ComponentModel.AddingNewEventArgs.NewObject> property of the <xref:System.ComponentModel.AddingNewEventArgs> parameter to the new item.

Otherwise, the new item is automatically created through its public parameterless constructor.
Otherwise, the new item is automatically created through its public parameterless constructor.

2. The position of the new item is tracked, but it is not added to the list until one of the following conditions are met:
2. The position of the new item is tracked, but it is not added to the list until one of the following conditions are met:

- The item is explicitly committed by a call to <xref:System.ComponentModel.BindingList`1.EndNew*>.

- The item is implicitly committed by some other operation that changed the contents of the list, such as an insertion or removal of an item.
- The item is explicitly committed by a call to <xref:System.ComponentModel.BindingList`1.EndNew*>.
- The item is implicitly committed by some other operation that changed the contents of the list, such as an insertion or removal of an item.

In contrast, calling the <xref:System.ComponentModel.BindingList`1.CancelNew*> method before the item is committed will cause the new item to be discarded.

This method raises the <xref:System.ComponentModel.BindingList`1.ListChanged> event when the new item is committed.



## Examples
The following code example demonstrates how to use the <xref:System.ComponentModel.BindingList`1.AddNew*> method. <xref:System.ComponentModel.BindingList`1>. For the complete example, see the <xref:System.ComponentModel.BindingList`1> class overview topic.

Expand Down
14 changes: 7 additions & 7 deletions xml/System.Configuration/ConfigurationCollectionAttribute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@

- The attributes that instruct .NET how to create instances of the custom configuration element properties. These types include:

- <xref:System.Configuration.ConfigurationCollectionAttribute>
- <xref:System.Configuration.ConfigurationCollectionAttribute>

- <xref:System.Configuration.ConfigurationPropertyAttribute>
- <xref:System.Configuration.ConfigurationPropertyAttribute>

- The attributes that instruct .NET how to validate the custom configuration element properties. These types include:

- <xref:System.Configuration.IntegerValidatorAttribute>
- <xref:System.Configuration.IntegerValidatorAttribute>

- <xref:System.Configuration.LongValidatorAttribute>
- <xref:System.Configuration.LongValidatorAttribute>

- <xref:System.Configuration.RegexStringValidatorAttribute>
- <xref:System.Configuration.RegexStringValidatorAttribute>

- <xref:System.Configuration.StringValidatorAttribute>
- <xref:System.Configuration.StringValidatorAttribute>

- <xref:System.Configuration.TimeSpanValidatorAttribute>
- <xref:System.Configuration.TimeSpanValidatorAttribute>

## Examples
The following example shows how to use the <xref:System.Configuration.ConfigurationCollectionAttribute>.
Expand Down
18 changes: 9 additions & 9 deletions xml/System.Configuration/ConfigurationPropertyAttribute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@

The .NET configuration system provides attribute types that you can use during the creation of custom configuration elements. There are two kinds of attribute types:

1. The types instructing .NET how to instantiate the custom configuration-element properties. These types include:
1. The types instructing .NET how to instantiate the custom configuration-element properties. These types include:

- <xref:System.Configuration.ConfigurationCollectionAttribute>
- <xref:System.Configuration.ConfigurationCollectionAttribute>

- <xref:System.Configuration.ConfigurationPropertyAttribute>
- <xref:System.Configuration.ConfigurationPropertyAttribute>

2. The types instructing .NET how to validate the custom configuration-element properties. These types include:
2. The types instructing .NET how to validate the custom configuration-element properties. These types include:

- <xref:System.Configuration.IntegerValidatorAttribute>
- <xref:System.Configuration.IntegerValidatorAttribute>

- <xref:System.Configuration.LongValidatorAttribute>
- <xref:System.Configuration.LongValidatorAttribute>

- <xref:System.Configuration.RegexStringValidatorAttribute>
- <xref:System.Configuration.RegexStringValidatorAttribute>

- <xref:System.Configuration.StringValidatorAttribute>
- <xref:System.Configuration.StringValidatorAttribute>

- <xref:System.Configuration.TimeSpanValidatorAttribute>
- <xref:System.Configuration.TimeSpanValidatorAttribute>



Expand Down
18 changes: 6 additions & 12 deletions xml/System.Configuration/ConfigurationSection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,19 @@

- Reading. You use <see cref="M:System.Configuration.Configuration.GetSection(System.String)" /> or <see cref="M:System.Configuration.Configuration.GetSectionGroup(System.String)" /> to read configuration information. Note that the user or process that reads must have the following permissions:

- Read permission on the configuration file at the current configuration hierarchy level.
- Read permission on the configuration file at the current configuration hierarchy level.
- Read permissions on all the parent configuration files.

- Read permissions on all the parent configuration files.
If your application needs read-only access to its own configuration, it is recommended you use the <see cref="Overload:System.Web.Configuration.WebConfigurationManager.GetSection" /> overloaded methods in the case of Web applications, or the <see cref="M:System.Configuration.ConfigurationManager.GetSection(System.String)" /> method in the case of client applications.

If your application needs read-only access to its own configuration, it is recommended you use the <see cref="Overload:System.Web.Configuration.WebConfigurationManager.GetSection" /> overloaded methods in the case of Web applications, or the <see cref="M:System.Configuration.ConfigurationManager.GetSection(System.String)" /> method in the case of client applications.

These methods provide access to the cached configuration values for the current application, which has better performance than the <see cref="T:System.Configuration.Configuration" /> class.
These methods provide access to the cached configuration values for the current application, which has better performance than the <see cref="T:System.Configuration.Configuration" /> class.

Note: If you use a static <see langword="GetSection" /> method that takes a <paramref name="path" /> parameter, the <paramref name="path" /> parameter must refer to the application in which the code is running; otherwise, the parameter is ignored and configuration information for the currently-running application is returned.

- Writing. You use one of the <see cref="Overload:System.Configuration.Configuration.Save" /> methods to write configuration information. Note that the user or process that writes must have the following permissions:

- Write permission on the configuration file and directory at the current configuration hierarchy level.

- Read permissions on all the configuration files.</para>
- Write permission on the configuration file and directory at the current configuration hierarchy level.
- Read permissions on all the configuration files.</para>
</block>
<altmember cref="T:System.Configuration.Configuration" />
<altmember cref="T:System.Configuration.SectionInformation" />
Expand Down Expand Up @@ -129,8 +127,6 @@ Note: If you use a static <see langword="GetSection" /> method that takes a <par
## Remarks
To use the <xref:System.Configuration.ConfigurationSection.%23ctor*> constructor, you need to define a custom section type first. For an example see the <xref:System.Configuration.ConfigurationSection> class overview.



## Examples
The following example shows how to use the <xref:System.Configuration.ConfigurationSection.%23ctor*> constructor. This example assumes that you have created a custom section class named `CustomSection`. For an example of such a class, see the <xref:System.Configuration.ConfigurationSection> class overview.

Expand Down Expand Up @@ -235,8 +231,6 @@ Note: If you use a static <see langword="GetSection" /> method that takes a <par

By default, <xref:System.Configuration.ConfigurationSection.GetRuntimeObject*> simply returns the object that represents the <xref:System.Configuration.ConfigurationSection> from which it is called.



## Examples
The following example shows how to use the <xref:System.Configuration.ConfigurationSection.GetRuntimeObject*> method.

Expand Down
Loading
Loading