예제 #1
0
파일: Firm1.cs 프로젝트: profimedica/SYKYO
        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);
            }
        }
예제 #2
0
 public CodeRelation(CodeRelation.ReletionType relationType)
 {
     this.relationType = (int)relationType;
 }