Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase Class Reference

Detailed Description

Collection of the tags.

Different collections could be merged to each other. In case if the Tag instance collides by the key to a tag in merge target collection then collided tag will be updated with the source one via the Tag.MergeTo(Tag) handler.

Inheritance diagram for Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase:
Collaboration diagram for Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase:

Public Member Functions

 TagsDatabase ()
 Empty constructor.
 
 TagsDatabase (params Tag[] tags)
 Creates the collection with defined tags. More...
 
void MergeTo (TagsDatabase to)
 Cloning the data from the collection to another collection. Colliding tags will be merged via the Tag.MergeTo(Tag) handler. More...
 
void Clear ()
 Clearing tags collection.
 
bool Contains (string key)
 Looking for tag by the key. More...
 
bool Contains (Tag item)
 Looking for tag by the key. More...
 
void CopyTo (Tag[] array, int arrayIndex)
 Copies tags at the data base to array. More...
 
void CopyTo (string[] array, int arrayIndex)
 Copies tag keys at the data base to array. More...
 
void Add (string tagKey)
 Generates default tag with defined key. More...
 
void Add (Tag tag)
 Generates default tag with defined key. More...
 
bool Remove (string tagKey)
 Removing the tag by the key. More...
 
bool Remove (Tag tag)
 Looking for the tag with the same name. More...
 
IEnumerator< TagGetEnumerator ()
 Returns enumerator of the Tag elements at the collection. More...
 
object Clone ()
 Clones database to new instance. More...
 
int IndexOf (string tagKey)
 Looking for index of tag with the same Tag.Key value. More...
 
int IndexOf (Tag tag)
 Looking for index of tag with the same Tag.Key value. More...
 
void Insert (int index, string tagKey)
 Inserting the tag at the position. More...
 
void Insert (int index, Tag tag)
 Inserting the tag at the position. More...
 
void RemoveAt (int index)
 Removing Tag bu index. More...
 
void MergeTo (IMergeableResource to)
 Redirecting to the MergeTo(TagsDatabase) with safe cast of resource to the TagsDatabase. More...
 
void MergeTo (T to)
 Sharing itself values to some another merging resource. More...
 

Properties

bool Modified [get]
 True if collection order was changed. More...
 
int Count [get]
 Count of tags in the collection.
 
bool IsReadOnly [get]
 Always false
 
Tag this[int index] [get, set]
 Provides access to Tag instance by the index. More...
 

Events

static System.Action< TagsDatabase, string > TagRemoved
 Occurs when a tag removed from any of databases, Shared values: TagsDatabase: source database. string: is Tag.Key of removed tag.
 

Constructor & Destructor Documentation

◆ TagsDatabase()

Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.TagsDatabase ( params Tag[]  tags)

Creates the collection with defined tags.

Parameters
tagsCollection of the tags.
Exceptions
TagAlreadyExistsExceptionA tag with the same Tag.Key already exists in the collection.

Member Function Documentation

◆ Add() [1/2]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Add ( string  tagKey)

Generates default tag with defined key.

Parameters
tagKeyA name for the tag. Must be unique for collection.
Exceptions
TagAlreadyExistsExceptionA tag with the same Tag.Key already exists in the collection.

◆ Add() [2/2]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Add ( Tag  tag)

Generates default tag with defined key.

Parameters
tagNew tag.
Exceptions
TagAlreadyExistsExceptionA tag with the same Tag.Key already exists in the collection.

◆ Clone()

object Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Clone ( )

Clones database to new instance.

Returns
new TagsDatabase instance.

◆ Contains() [1/2]

bool Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Contains ( string  key)

Looking for tag by the key.

Parameters
keyTarget tag's key.
Returns
Search result.

◆ Contains() [2/2]

bool Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Contains ( Tag  item)

Looking for tag by the key.

Parameters
itemTarget tag. In comparison using only Tag.Key value.
Returns
Search result.

◆ CopyTo() [1/2]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.CopyTo ( string[]  array,
int  arrayIndex 
)

Copies tag keys at the data base to array.

Parameters
arrayDestination array.
arrayIndexStart index at the destination array.

◆ CopyTo() [2/2]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.CopyTo ( Tag[]  array,
int  arrayIndex 
)

Copies tags at the data base to array.

Parameters
arrayDestination array.
arrayIndexStart index at the destination array.

◆ GetEnumerator()

IEnumerator< Tag > Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.GetEnumerator ( )

Returns enumerator of the Tag elements at the collection.

Returns
Enumerator of tags.

◆ IndexOf() [1/2]

int Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.IndexOf ( string  tagKey)

Looking for index of tag with the same Tag.Key value.

Parameters
tagKeySearch key.
Returns
Index of the Tag. -1 if not found.

◆ IndexOf() [2/2]

int Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.IndexOf ( Tag  tag)

Looking for index of tag with the same Tag.Key value.

Parameters
tagSource tag.
Returns
Index of the Tag. -1 if not found.

◆ Insert() [1/2]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Insert ( int  index,
string  tagKey 
)

Inserting the tag at the position.

Parameters
indexTarget position.
tagKeyTag key. The tag will created via the Tag.Tag(string) constructor.
Exceptions
TagAlreadyExistsExceptionTag already exists into the database.

◆ Insert() [2/2]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Insert ( int  index,
Tag  tag 
)

Inserting the tag at the position.

Parameters
indexTarget position.
tagThe tag to insert.
Exceptions
TagAlreadyExistsExceptionTag already exists into the database.

◆ MergeTo() [1/3]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.MergeTo ( IMergeableResource  to)

Redirecting to the MergeTo(TagsDatabase) with safe cast of resource to the TagsDatabase.

Parameters
toTarget resource.

◆ MergeTo() [2/3]

Sharing itself values to some another merging resource.

Parameters
toTarget resource that will contains the value merged with stored in this resource.

◆ MergeTo() [3/3]

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.MergeTo ( TagsDatabase  to)

Cloning the data from the collection to another collection. Colliding tags will be merged via the Tag.MergeTo(Tag) handler.

Parameters
toTarget collection.

◆ Remove() [1/2]

bool Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Remove ( string  tagKey)

Removing the tag by the key.

Parameters
tagKeyKey of the tag for remove.
Returns
Is the tag removed from collection?

◆ Remove() [2/2]

bool Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Remove ( Tag  tag)

Looking for the tag with the same name.

Parameters
tagThe tag for remove. Important only the Tag.Key value.
Returns
Is the tag removed from collection?

◆ RemoveAt()

void Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.RemoveAt ( int  index)

Removing Tag bu index.

Parameters
indexIndex to remove.

Property Documentation

◆ Modified

bool Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.Modified
get

True if collection order was changed.

In some cases collection can't be considered like a stable when its content modified.

◆ this[int index]

Tag Doloro.DataManagement.DynamicResources.Modules.TagsTool.TagsDatabase.this[int index]
getset

Provides access to Tag instance by the index.

Parameters
indexIndex of tag at database.
Returns
Reference to the tag.

The documentation for this class was generated from the following file: