Class FormatsCollection
Represents collection of formats in the workbook.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.Collections
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class FormatsCollection : CommonObject, IParentApplication, IDisposable
Constructors
FormatsCollection(IApplication, Object)
Initializes new instance and sets its application and parent objects.
Declaration
public FormatsCollection(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object to set. |
System.Object | parent | Parent object to set. |
Fields
Currency
Represents the Currency Symbol. TODO: support currency based on the Culture.
Declaration
public const string Currency = "$"
Field Value
Type | Description |
---|---|
System.String |
Date
Represents the index of the date format.
Declaration
public const string Date = "date"
Field Value
Type | Description |
---|---|
System.String |
DecimalSeparator
Represents the Decimal Seprator.
Declaration
public const string DecimalSeparator = "."
Field Value
Type | Description |
---|---|
System.String |
DEFAULT_EXPONENTAIL
Represents the default exponential.
Declaration
public const string DEFAULT_EXPONENTAIL = "E+"
Field Value
Type | Description |
---|---|
System.String |
Exponent
Represents the Exponenet Symbol.
Declaration
public const string Exponent = "E"
Field Value
Type | Description |
---|---|
System.String |
Fraction
Represents the fraction symbol.
Declaration
public const string Fraction = "/"
Field Value
Type | Description |
---|---|
System.String |
Minus
Represents the Minus symbol.
Declaration
public const string Minus = "-"
Field Value
Type | Description |
---|---|
System.String |
Percentage
Represents the percentage in decimal numbers.
Declaration
public const string Percentage = "%"
Field Value
Type | Description |
---|---|
System.String |
ThousandSeparator
Represents the Thousand seprator.
Declaration
public const string ThousandSeparator = ","
Field Value
Type | Description |
---|---|
System.String |
Time
Represents the time separator.
Declaration
public const string Time = ":"
Field Value
Type | Description |
---|---|
System.String |
Properties
Count
Gets the number of elements contained in the collection. Read-only
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsFixedSize
Gets a value indicating whether the collection has a fixed size. Read-only.
Declaration
public bool IsFixedSize { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsReadOnly
Gets a value indicating whether the IDictionary is read-only. Read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSynchronized
Gets a value indicating whether access to the collection is synchronized (thread-safe).
Declaration
public bool IsSynchronized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Int32]
Returns single entry from the collection. Read-only.
Declaration
[CLSCompliant(false)]
public FormatImpl this[int iIndex] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex |
Property Value
Type | Description |
---|---|
FormatImpl |
Item[String]
Returns single entry from the collection by format string. Read-only.
Declaration
[CLSCompliant(false)]
public FormatImpl this[string strFormat] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | strFormat |
Property Value
Type | Description |
---|---|
FormatImpl |
Keys
Gets an ICollection containing the keys of the collection. Read-only.
Declaration
public ICollection Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.ICollection |
Parser
Returns format parser. Read-only.
Declaration
public FormatParserImpl Parser { get; }
Property Value
Type | Description |
---|---|
FormatParserImpl |
SyncRoot
Gets an object that can be used to synchronize access to the collection.
Declaration
public object SyncRoot { get; }
Property Value
Type | Description |
---|---|
System.Object |
Values
Declaration
public ICollection Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.ICollection |
Methods
Add(FormatRecord)
Adds new format to the collection.
Declaration
[CLSCompliant(false)]
public void Add(FormatRecord format)
Parameters
Type | Name | Description |
---|---|---|
FormatRecord | format | Format to add. |
AddRange(IDictionary, FormatsCollection)
Adds format range to the collection.
Declaration
public Dictionary<int, int> AddRange(IDictionary dicIndexes, FormatsCollection source)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IDictionary | dicIndexes | Dictionary with format indexes to add. |
FormatsCollection | source | Source collection. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | Dictionary with updated indexes: key - old index, value - new index. |
Clear()
Removes all elements from the IDictionary.
Declaration
public void Clear()
Clone(Object)
Creates copy of the current instance.
Declaration
public FormatsCollection Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new collection. |
Returns
Type | Description |
---|---|
FormatsCollection | Copy of the current instance. |
Contains(Int32)
Determines whether the IDictionary contains an element with the specified key.
Declaration
public bool Contains(int key)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The key to locate in the IDictionary. |
Returns
Type | Description |
---|---|
System.Boolean | True if the IDictionary contains an element with the key; otherwise, False. |
ContainsFormat(String)
Determines whether the IDictionary contains an element with the specified format.
Declaration
public bool ContainsFormat(string formatString)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatString | Format to locate in the collection. |
Returns
Type | Description |
---|---|
System.Boolean | True if the collection contains an element with the key; otherwise, False. |
CopyTo(Array, Int32)
Copies the elements of the collection to an Array, starting at a particular Array index.
Declaration
public void CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing. |
System.Int32 | index | The zero-based index in array at which copying begins. |
CreateFormat(String)
Method that creates format object based on the format string and registers it in the workbook.
Declaration
public int CreateFormat(string formatString)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatString | Format string for the new format record. |
Returns
Type | Description |
---|---|
System.Int32 | Index of created format. |
FindOrCreateFormat(String)
Searches for format with specified format string and creates one if a match is not found.
Declaration
public int FindOrCreateFormat(string formatString)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatString | String describing needed format. |
Returns
Type | Description |
---|---|
System.Int32 | Found or created format. |
GetEnumerator()
Returns an IDictionaryEnumerator for the IDictionary.
Declaration
public IEnumerator<KeyValuePair<int, FormatImpl>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.Int32, FormatImpl>> | An IDictionaryEnumerator for the IDictionary. |
GetUsedFormats(ExcelVersion)
Gets all used formats.
Declaration
public List<FormatRecord> GetUsedFormats(ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
ExcelVersion | version |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<FormatRecord> | Array that contains all used format records. |
InsertDefaultFormats()
Inserts all default formats into list.
Declaration
public void InsertDefaultFormats()
Merge(FormatsCollection)
Copies all formats from the source collection.
Declaration
public Dictionary<int, int> Merge(FormatsCollection source)
Parameters
Type | Name | Description |
---|---|---|
FormatsCollection | source | Collection to copy formats from. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | Dictionary old format index - to - new format index. |
Parse(IList, Int32)
Parses list of biff records.
Declaration
public int Parse(IList data, int iPos)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IList | data | Records to parse. |
System.Int32 | iPos | Offset to the format records. |
Returns
Type | Description |
---|---|
System.Int32 | Position after format records. |
Remove(Int32)
Removes the element with the specified key from the IDictionary.
Declaration
public void Remove(int key)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The key of the element to remove. |
Serialize(OffsetArrayList)
Saves formats into list of biff records.
Declaration
[CLSCompliant(false)]
public void Serialize(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | List to save into. |