Class RelationCollection
Class used for Relations Collection.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.XmlSerialization
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class RelationCollection : IEnumerable, ICloneable
Constructors
RelationCollection()
Initializes a new instance of the RelationsCollection class.
Declaration
public RelationCollection()
Properties
Count
Gets number of items in the collection. Read-only.
Declaration
public int Count { get; }
Property Value
| Type |
|---|
| int |
this[string]
Gets / sets relation by id.
Declaration
public Relation this[string id] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | id |
Property Value
| Type |
|---|
| Relation |
ItemPath
Gets or sets path to the item (this member should be filled when extracting collection from file).
Declaration
public string ItemPath { get; set; }
Property Value
| Type |
|---|
| string |
Methods
Add(Relation)
Generates id and adds relations to there collection.
Declaration
public string Add(Relation relation)
Parameters
| Type | Name | Description |
|---|---|---|
| Relation | relation | Relation to add. |
Returns
| Type | Description |
|---|---|
| string | Relation id. |
Clear()
Removes all items from the collection.
Declaration
public void Clear()
Clone()
Creates copy of the current collection.
Declaration
public RelationCollection Clone()
Returns
| Type | Description |
|---|---|
| RelationCollection | A copy of the current collection. |
Dispose()
Dispose Relations
Declaration
public void Dispose()
FindRelationByContentType(string, out string)
Searches for relation with appropriate content type.
Declaration
public Relation FindRelationByContentType(string contentType, out string relationId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contentType | Content type to find. |
| string | relationId | Relation id. |
Returns
| Type | Description |
|---|---|
| Relation | Relation that contains desired content type or null if not found. |
FindRelationByTarget(string)
Searches for relation with appropriate target path.
Declaration
public string FindRelationByTarget(string itemName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | itemName | Item name to find. |
Returns
| Type | Description |
|---|---|
| string | Relation id that contains points to specified content type or null if not found. |
GenerateRelationId()
Generates relation id that can be used as relation key.
Declaration
public string GenerateRelationId()
Returns
| Type | Description |
|---|---|
| string | Free relation key. |
GetEnumerator()
Returns an enumerator that can iterate through a collection.
Declaration
public IEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator | An IEnumerator that can be used to iterate through the collection. |
Remove(string)
Removes relation by id.
Declaration
public void Remove(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | Relation id to remove. |
RemoveByContentType(string)
Removes relation by content type.
Declaration
public void RemoveByContentType(string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contentType | Content type of relation to delete. |