StyleCollection Class
TOC
Collapse the table of content
Expand the table of content

StyleCollection Class

 

Represents a collection of Style objects.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.Web.UI.StateManagedCollection
    System.Web.UI.WebControls.StyleCollection

public class StyleCollection : StateManagedCollection

NameDescription
System_CAPS_pubpropertyCount

Gets the number of elements contained in the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubpropertyItem[Int32]

Gets the Style object at the specified index location in the StyleCollection object.

NameDescription
System_CAPS_pubmethodAdd(Style)

Appends a specified Style object to the end of the StyleCollection object.

System_CAPS_pubmethodClear()

Removes all items from the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubmethodContains(Style)

Determines whether the specified style is contained within the collection.

System_CAPS_pubmethodCopyTo(Array, Int32)

Copies the elements of the StateManagedCollection collection to an array, starting at a particular array index.(Inherited from StateManagedCollection.)

System_CAPS_pubmethodCopyTo(Style[], Int32)

Copies the elements of the StyleCollection to a one-dimensional Style array, starting at the specified index of the target array.

System_CAPS_protmethodCreateKnownType(Int32)

Creates an instance of the Style class, based on the single element collection returned by the GetKnownTypes method.(Overrides StateManagedCollection.CreateKnownType(Int32).)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an iterator that iterates through the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_protmethodGetKnownTypes()

Gets an array of the IStateManager types that the StyleCollection can contain.(Overrides StateManagedCollection.GetKnownTypes().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIndexOf(Style)

Returns the index of the specified Style object within the collection.

System_CAPS_pubmethodInsert(Int32, Style)

Inserts a specified Style object into the StyleCollection at the specified index location.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnClear()

When overridden in a derived class, performs additional work before the Clear method removes all items from the collection.(Inherited from StateManagedCollection.)

System_CAPS_protmethodOnClearComplete()

When overridden in a derived class, performs additional work after the Clear method finishes removing all items from the collection.(Inherited from StateManagedCollection.)

System_CAPS_protmethodOnInsert(Int32, Object)
System_CAPS_protmethodOnInsertComplete(Int32, Object)
System_CAPS_protmethodOnRemove(Int32, Object)

When overridden in a derived class, performs additional work before the M:System.Web.UI.StateManagedCollection.System.Collections.IList.Remove(System.Object) or M:System.Web.UI.StateManagedCollection.System.Collections.IList.RemoveAt(System.Int32) method removes the specified item from the collection.(Inherited from StateManagedCollection.)

System_CAPS_protmethodOnRemoveComplete(Int32, Object)

When overridden in a derived class, performs additional work after the M:System.Web.UI.StateManagedCollection.System.Collections.IList.Remove(System.Object) or M:System.Web.UI.StateManagedCollection.System.Collections.IList.RemoveAt(System.Int32) method removes the specified item from the collection.(Inherited from StateManagedCollection.)

System_CAPS_protmethodOnValidate(Object)

When overridden in a derived class, validates an element of the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubmethodRemove(Style)

Removes the specified Style object from the StyleCollection object.

System_CAPS_pubmethodRemoveAt(Int32)

Removes the Style object at the specified index location from the StyleCollection object.

System_CAPS_pubmethodSetDirty()

Forces the entire StateManagedCollection collection to be serialized into view state. (Inherited from StateManagedCollection.)

System_CAPS_protmethodSetDirtyObject(Object)

Instructs the input Style object contained in the collection to record its entire state to view state, rather than recording only change information.(Overrides StateManagedCollection.SetDirtyObject(Object).)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

This API supports the product infrastructure and is not intended to be used directly from your code. Returns an iterator that iterates through the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

Adds an item to the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Clear()

This API supports the product infrastructure and is not intended to be used directly from your code. Removes all items from the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

Determines whether the StateManagedCollection collection contains a specific value.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

Determines the index of a specified item in the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

Inserts an item into the StateManagedCollection collection at the specified index.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

Removes the first occurrence of the specified object from the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.RemoveAt(Int32)

Removes the IStateManager element at the specified index.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIStateManager.LoadViewState(Object)

Restores the previously saved view state of the StateManagedCollection collection and the IStateManager items it contains.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIStateManager.SaveViewState()

Saves the changes to the StateManagedCollection collection and each IStateManager object it contains since the time the page was posted back to the server.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIStateManager.TrackViewState()

Causes the StateManagedCollection collection and each of the IStateManager objects it contains to track changes to their view state so they can be persisted across requests for the same page.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.Count

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the number of elements contained in the StateManagedCollection collection.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the StateManagedCollection collection is synchronized (thread safe). This method returns false in all cases.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

This API supports the product infrastructure and is not intended to be used directly from your code. Gets an object that can be used to synchronize access to the StateManagedCollection collection. This method returns null in all cases.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsFixedSize

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the StateManagedCollection collection has a fixed size. This method returns false in all cases.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsReadOnly

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the StateManagedCollection collection is read-only.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.Item[Int32]

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the IStateManager element at the specified index.(Inherited from StateManagedCollection.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIStateManager.IsTrackingViewState

Gets a value indicating whether the StateManagedCollection collection is saving changes to its view state.(Inherited from StateManagedCollection.)

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

Use the StyleCollection class to store and manage Style objects for a control. Control developers can use this class to contain a set of styles that apply to different portions of the control.

The collection dynamically increases in size as objects are added. Indexes in this collection are zero-based. Use the Count property to determine how many objects are in the collection.

Additionally, use the StyleCollection methods and properties to provide the following functionality:

  • The Add method to add a single style to the collection.

  • The Insert method to add a style at a particular index within the collection.

  • The Remove method to remove a style from the collection.

  • The RemoveAt method to remove the style located at a particular index.

  • The Contains method to determine whether a particular style is already in the collection.

  • The IndexOf method to retrieve the index of a style within the collection.

  • The Clear method to remove all the styles from the collection.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft