Beispiel #1
0
        private void RemoveEaUmlClassifier(EaUmlClassifier classifier)
        {
            short      i          = 0;
            Collection eaElements = eaPackage.Elements;

            foreach (Element eaElement in eaElements)
            {
                if (eaElement.ElementID == classifier.Id)
                {
                    eaElements.Delete(i);
                }
                i++;
            }
            eaElements.Refresh();
        }
Beispiel #2
0
        private EaUmlClassifier CreateEaUmlClassifier(UmlClassifierSpec spec)
        {
            var eaElement = (Element)eaPackage.Elements.AddNew(spec.Name, "Class");

            eaElement.PackageID = Id;
            var eaUmlClassifier = new EaUmlClassifier(eaRepository, eaElement);

            eaUmlClassifier.Initialize(spec);
            AddToClassDiagram(eaElement);

            eaPackage.Update();
            eaPackage.Elements.Refresh();

            return(eaUmlClassifier);
        }
Beispiel #3
0
        public static bool isLiteralValue(Attribute eaAttribute, EaUmlClassifier owner)
        {
            //if the field StyleEx contains "IsLiteral=1" then it is a literal value
            //of if the StyleEx field is empty and the owner of this attribute is of type Enumeration
            var styleEx = eaAttribute.StyleEx;

            if (styleEx.Contains("IsLiteral=1"))
            {
                return(true);
            }
            if (styleEx.Contains("IsLiteral=0"))
            {
                return(false);
            }
            //no information in the StyleEx, check the owner
            return(owner.isEnumeration);
        }
Beispiel #4
0
 private static void UpdateEaUmlClassifier(EaUmlClassifier classifier, UmlClassifierSpec spec)
 {
     classifier.Update(spec);
 }