SelectedDatesCollection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public ref class SelectedDatesCollection sealed : System::Collections::ICollection
public sealed class SelectedDatesCollection : System.Collections.ICollection
type SelectedDatesCollection = class
interface ICollection
interface IEnumerable
Public NotInheritable Class SelectedDatesCollection
Implements ICollection
- Inheritance
-
SelectedDatesCollection
- Implements
Examples
The following code example demonstrates how to programmatically use the SelectedDatesCollection class to select dates in the Calendar control.
<%@ Page Language="C#"%>
ASP.NET Example
<%@ Page Language="VB"%>
ASP.NET Example
Remarks
Use this class to programmatically manage a collection of System.DateTime objects that represent the selected dates in a Calendar control. This class is commonly used to add or remove dates from the collection.
This collection stores only whole dates. The time portion of each System.DateTime is removed. The dates are stored in ascending order. If there are duplicate dates, only one date is stored in the collection.
Constructors
| Name | Description |
|---|---|
| SelectedDatesCollection(ArrayList) |
Initializes a new instance of the SelectedDatesCollection class with the specified date list. |
Properties
| Name | Description |
|---|---|
| Count |
Gets the number of DateTime objects in the SelectedDatesCollection collection. |
| IsReadOnly |
Gets a value indicating whether the SelectedDatesCollection collection is read-only. |
| IsSynchronized |
Gets a value indicating whether access to the SelectedDatesCollection collection is synchronized (thread safe). |
| Item[Int32] |
Gets a DateTime object at the specified index in the SelectedDatesCollection collection. |
| SyncRoot |
Gets the object that can be used to synchronize access to the SelectedDatesCollection collection. |
Methods
| Name | Description |
|---|---|
| Add(DateTime) |
Appends the specified DateTime object to the end of the SelectedDatesCollection collection. |
| Clear() |
Removes all DateTime objects from the collection. |
| Contains(DateTime) |
Returns a value indicating whether the SelectedDatesCollection collection contains the specified DateTime object. |
| CopyTo(Array, Int32) |
Copies the items from the SelectedDatesCollection collection to the specified Array, starting with the specified index. |
| Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
| GetEnumerator() |
Returns an IEnumerator-implemented object that contains all DateTime objects within the SelectedDatesCollection collection. |
| GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
| GetType() |
Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
| Remove(DateTime) |
Removes the specified DateTime object from the SelectedDatesCollection collection. |
| SelectRange(DateTime, DateTime) |
Adds the specified range of dates to the SelectedDatesCollection collection. |
| ToString() |
Returns a string that represents the current object. (Inherited from Object) |
Extension Methods
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Enables parallelization of a query. |
| AsQueryable(IEnumerable) |
Converts an IEnumerable to an IQueryable. |
|
Cast |
Casts the elements of an IEnumerable to the specified type. |
|
OfType |
Filters the elements of an IEnumerable based on a specified type. |