private void CreateRelationHasA(CodeElement objA, CodeElement objB, CodeRelation.ReletionType relationType, CodeRelation.ReletionMultiplicity relationMultiplicity) { CodeRelation codeRelation = null; if (objA.Properties == null) { objA.Properties = new List<CodeRelation>(); } if (null == (codeRelation = objA.Properties.FirstOrDefault(p => p.RelationType == (int)relationType))) { codeRelation = new CodeRelation(relationType); //codeRelation.Childs = new List<Multiplicity>(); objA.Properties.Add(codeRelation); } if (codeRelation.Childs.FirstOrDefault(p => p.CodeElement.Name == objB.Name) == null) { Arrow multiplicity = new Arrow(); multiplicity.CodeElement = objB; multiplicity.Multiplicity = (int)relationMultiplicity; codeRelation.Childs.Add(multiplicity); } }
public CodeRelation(CodeRelation.ReletionType relationType) { this.relationType = (int)relationType; }