public Relation SetRelation(ChatUser target, Relation.Type relationType, bool isSource = true) { if (target == null) { throw new ArgumentNullException("Target must not be null!"); } Relation relation; Guid relationID; if (this.Relationship.ContainsKey(target.ID)) { this.Relationship.TryGetValue(target.ID, out relationID); relation = Relation.Get(relationID); } else { relation = new Relation(this.ID, target.ID, 1); this.Relationship.Add(target.ID, relation.ID); target.Relationship.Add(this.ID, relation.ID); this.Save(); target.Save(); } relation.RelationType = relationType; relation.Save(); return(relation); }
public AddRelationCommand(ObservableCollection <Relation> relations, Klass klass1, Klass klass2, Relation.Type relationType) { _klass1 = klass1; _klass2 = klass2; _relation = new Relation(relationType); _relations = relations; }
private void AddCompostion() { _relationType = Relation.Type.Composition; AddRelation(); }
private void AddInheritance() { _relationType = Relation.Type.Inheritance; AddRelation(); }
private void AddReference() { _relationType = Relation.Type.Reference; AddRelation(); }