Class RelationCollection
Class used for Relations Collection.
Inheritance
Implements
Namespace: Syncfusion.XlsIO.Implementation.XmlSerialization
Assembly: Syncfusion.XlsIO.Portable.dll
Syntax
public class RelationCollection : Object, 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 | 
|---|
| System.Int32 | 
Item[String]
Gets / sets relation by id.
Declaration
public Relation this[string id] { get; set; }
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.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 | 
|---|
| System.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 | 
|---|---|
| System.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 | 
|---|---|---|
| System.String | contentType | Content type to find.  | 
      
| System.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 | 
|---|---|---|
| System.String | itemName | Item name to find.  | 
      
Returns
| Type | Description | 
|---|---|
| System.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 | 
|---|---|
| System.String | Free relation key.  | 
      
GetEnumerator()
Returns an enumerator that can iterate through a collection.
Declaration
public IEnumerator GetEnumerator()
  Returns
| Type | Description | 
|---|---|
| System.Collections.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 | 
|---|---|---|
| System.String | id | Relation id to remove.  | 
      
RemoveByContentType(String)
Removes relation by content type.
Declaration
public void RemoveByContentType(string contentType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | contentType | Content type of relation to delete.  |