Class StyleCollection
Represents a collection of styles used in the Styles.
Inheritance
Implements
Inherited Members
Namespace: FastReport
Assembly: FastReport.OpenSource.dll
Syntax
public class StyleCollection : CollectionBase, IList, ICollection, IEnumerable, IFRSerializable
Constructors
StyleCollection()
Initializes a new instance of the StyleCollection class with default settings.
Declaration
public StyleCollection()
Properties
Item[Int32]
Gets or sets the element at the specified index.
Declaration
public Style this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of an element. |
Property Value
Type | Description |
---|---|
Style | The element at the specified index. |
Name
Gets or sets the name of the style.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Add(Style)
Adds an object to the end of this collection.
Declaration
public int Add(Style value)
Parameters
Type | Name | Description |
---|---|---|
Style | value | Object to add. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the added object. |
AddRange(Style[])
Adds the specified elements to the end of this collection.
Declaration
public void AddRange(Style[] range)
Parameters
Type | Name | Description |
---|---|---|
Style[] | range |
Clone()
Creates exact copy of this collection.
Declaration
public StyleCollection Clone()
Returns
Type | Description |
---|---|
StyleCollection | The copy of this collection. |
Contains(Style)
Determines whether an element is in the collection.
Declaration
public bool Contains(Style value)
Parameters
Type | Name | Description |
---|---|---|
Style | value | The object to locate in the collection. |
Returns
Type | Description |
---|---|
System.Boolean | true if object is found in the collection; otherwise, false. |
Contains(String)
Determines whether a style with specified name is in the collection.
Declaration
public bool Contains(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The style name to locate in the collection. |
Returns
Type | Description |
---|---|
System.Boolean | true if object is found in the collection; otherwise, false. |
Deserialize(FRReader)
Deserializes the object.
Declaration
public void Deserialize(FRReader reader)
Parameters
Type | Name | Description |
---|---|---|
FRReader | reader | Reader object. |
IndexOf(Style)
Returns the zero-based index of the first occurrence of an object.
Declaration
public int IndexOf(Style value)
Parameters
Type | Name | Description |
---|---|---|
Style | value | The object to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | The zero-based index of the first occurrence of value within the entire collection, if found; otherwise, -1. |
IndexOf(String)
Returns the zero-based index of the first occurrence of a style with specified name.
Declaration
public int IndexOf(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The name to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | The zero-based index of the first occurrence of value within the entire collection, if found; otherwise, -1. |
Insert(Int32, Style)
Inserts an object into this collection at the specified index.
Declaration
public void Insert(int index, Style value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which value should be inserted. |
Style | value | The object to insert. |
Load(Stream)
Loads the collection from a stream.
Declaration
public void Load(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to load from. |
Load(String)
Loads the collection from a file.
Declaration
public void Load(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of the file. |
Remove(Style)
Removes the specified object from the collection.
Declaration
public void Remove(Style value)
Parameters
Type | Name | Description |
---|---|---|
Style | value | Object to remove. |
Save(Stream)
Saves the collection to a stream.
Declaration
public void Save(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to save to. |
Save(String)
Saves the collection to a file.
Declaration
public void Save(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of the file. |
Serialize(FRWriter)
Serializes the object.
Declaration
public void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |