internal void Add(String Name, Model.Item Item) { if (Item is Relationship) { Model.Relationship relationship = (Model.Relationship)Item; if (this.ActionsCache.ContainsKey(relationship.Source.ID)) { Action sourceaction = this.ActionsCache[relationship.Source.ID]; if (this.ActionsCache.ContainsKey(relationship.ID)) { this.ActionsCache[relationship.ID].Name = Name; } else { Actions.Relationship relationshipaction = new Actions.Relationship(this, Name, relationship); this.ActionsCache[relationship.Source.ID].AddRelationship(relationshipaction); this.ActionsCache[relationship.ID] = relationshipaction; } } else { throw new Exceptions.ArgumentException("Source Item not present in Transaction"); } } else if (Item is File) { if (this.ActionsCache.ContainsKey(Item.ID)) { this.ActionsCache[Item.ID].Name = Name; } else { this.ActionsCache[Item.ID] = new Actions.File(this, Name, Item); } } else { if (this.ActionsCache.ContainsKey(Item.ID)) { this.ActionsCache[Item.ID].Name = Name; } else { this.ActionsCache[Item.ID] = new Actions.Item(this, Name, Item); } } }
internal void AddRelationship(Actions.Relationship Relationship) { this.RelationshipsCache[Relationship.Item.ID] = Relationship; }