Example #1
0
        public static EAAPI.Attribute AddAttribute(this EAAPI.Element parent, string name, string type)
        {
            EAAPI.Attribute attribute = (EAAPI.Attribute)parent.Attributes.AddNew(name, type);
            attribute.Update();
            parent.Attributes.Refresh();

            return(attribute);
        }
Example #2
0
        public static EAAPI.Element GetClassifier(this EAAPI.Attribute attribute, EAAPI.Repository repository)
        {
            EAAPI.Element result = null;

            if (attribute.ClassifierID != 0)
            {
                result = repository.GetElementByID(attribute.ClassifierID);
            }

            return(result);
        }
Example #3
0
        public static string GetClassifierName(this EAAPI.Attribute attribute, EAAPI.Repository repository)
        {
            string result = "";

            if (attribute.ClassifierID != 0)
            {
                result = repository.GetElementByID(attribute.ClassifierID).Name;
            }
            else if (attribute.ClassifierID == 0 && !string.IsNullOrEmpty(attribute.Type))
            {
                result = attribute.Type;
            }

            return(result);
        }