Class WorksheetModelCollection
Represents a collection of WorksheetModel objects.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class WorksheetModelCollection : CollectionBase, IList, ICollection, IEnumerable, IDisposable, ISerializable
Constructors
WorksheetModelCollection()
Initializes a new instance of the WorksheetModelCollection class.
Declaration
public WorksheetModelCollection()
WorksheetModelCollection(WorksheetModel[])
Initializes a new instance of the WorksheetModelCollection class containing the specified array of WorksheetModel objects.
Declaration
public WorksheetModelCollection(WorksheetModel[] value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel[] | value | An array of WorksheetModel objects with which to initialize the collection. |
WorksheetModelCollection(WorksheetModelCollection)
Initializes a new instance of the WorksheetModelCollection class containing the elements of the specified source collection.
Declaration
public WorksheetModelCollection(WorksheetModelCollection value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModelCollection | value | A WorksheetModelCollection with which to initialize the collection. |
WorksheetModelCollection(SerializationInfo, StreamingContext)
Initializes a new WorksheetModelCollection from a serialization stream.
Declaration
protected WorksheetModelCollection(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or deserialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Properties
Item[Int32]
Gets / sets the WorksheetModel at the specified index.
Declaration
public WorksheetModel this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
WorksheetModel |
Updating
Indicates whether BeginUpdate() was called.
Declaration
public virtual bool Updating { get; }
Property Value
Type |
---|
System.Boolean |
Methods
Add(WorksheetModel)
Adds the specified WorksheetModel to the collection.
Declaration
public int Add(WorksheetModel value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel | value | The WorksheetModel to add. |
Returns
Type | Description |
---|---|
System.Int32 | The index at which the new element was inserted. |
AddRange(WorksheetModel[])
Overloaded. Copies the elements of the specified array to the end of the collection.
Declaration
public void AddRange(WorksheetModel[] value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel[] | value | An array of type WorksheetModel containing the objects to add to the collection. |
AddRange(WorksheetModelCollection)
Adds the contents of another WorksheetModelCollection to the end of the collection.
Declaration
public void AddRange(WorksheetModelCollection value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModelCollection | value | A WorksheetModelCollection containing the objects to add to the collection. |
BeginUpdate()
Suspend updating the display.
Declaration
public virtual void BeginUpdate()
Contains(WorksheetModel)
Indicates whether the collection contains the specified WorksheetModel.
Declaration
public bool Contains(WorksheetModel value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel | value | The WorksheetModel to search for in the collection. |
Returns
Type | Description |
---|---|
System.Boolean | langword_csharp_True if the collection contains the specified object; langword_csharp_False otherwise. |
CopyTo(WorksheetModel[], Int32)
Copies the collection objects to a one-dimensional System.Array instance beginning at the specified index.
Declaration
public void CopyTo(WorksheetModel[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel[] | array | The one-dimensional System.Array that is the destination of the values copied from the collection. |
System.Int32 | index | The index of the array at which to begin inserting. |
CreateEmptyWorksheet(WorkbookModel)
Creates a new empty WorksheetModel and names it "Sheet #".
Declaration
public WorksheetModel CreateEmptyWorksheet(WorkbookModel workbook)
Parameters
Type | Name | Description |
---|---|---|
WorkbookModel | workbook | The WorkbookModel this new sheet is added to. |
Returns
Type | Description |
---|---|
WorksheetModel | The new WorksheetModel. |
Dispose()
Releases any resources used.
Declaration
public void Dispose()
EndUpdate()
Resumes updating the display.
Declaration
public virtual void EndUpdate()
IndexOf(WorksheetModel)
Returns the index in the collection of the specified WorksheetModel, if it exists in the collection.
Declaration
public int IndexOf(WorksheetModel value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel | value | The WorksheetModel to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | The index in the collection of the specified object, if found; -1 otherwise. |
IndexOf(String)
Returns the index of a sheet with the specified name.
Declaration
public int IndexOf(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the sheet to find. |
Returns
Type | Description |
---|---|
System.Int32 | The index of the sheet with the specified name; -1 if not found. |
Insert(Int32, WorksheetModel)
Inserts the specified WorksheetModel into the collection at the specified index.
Declaration
public void Insert(int index, WorksheetModel value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index where the specified object should be inserted. |
WorksheetModel | value |
Move(Int32, Int32)
Moves a worksheet from one position to another.
Declaration
public void Move(int index, int destination)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The original index of the worksheet. |
System.Int32 | destination | The new index of the worksheet. |
OnClearComplete()
Declaration
protected override void OnClearComplete()
Overrides
OnInsertComplete(Int32, Object)
Declaration
protected override void OnInsertComplete(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |
Overrides
OnRemoveComplete(Int32, Object)
Declaration
protected override void OnRemoveComplete(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |
Overrides
OnSetComplete(Int32, Object, Object)
Declaration
protected override void OnSetComplete(int index, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | oldValue | |
System.Object | newValue |
Overrides
OnSheetMoved(Int32, Int32, SheetMovedReason)
Called when the order of the worksheet has changed.
Declaration
protected virtual void OnSheetMoved(int index, int destination, SheetMovedReason reason)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The original index of an affected worksheet. |
System.Int32 | destination | The new index of an affected worksheet |
SheetMovedReason | reason | The reason for the change. |
OnValidate(Object)
Declaration
protected override void OnValidate(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Overrides
Remove(WorksheetModel)
Removes the specified WorksheetModel from the collection.
Declaration
public void Remove(WorksheetModel value)
Parameters
Type | Name | Description |
---|---|---|
WorksheetModel | value | The WorksheetModel to remove from the collection. |
Events
SheetMoved
Occurs when the order of sheets has been changed.
Declaration
public event SheetMovedEventHandler SheetMoved
Event Type
Type |
---|
SheetMovedEventHandler |
Explicit Interface Implementations
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |