Ejemplo n.º 1
0
        public static string GetClassifierName(this EAAPI.Element element, EAAPI.Repository repository)
        {
            string result = "";

            int classiferID = 0;

            if (element.Type == "Port" || element.Type == "Part" || element.Type == "ActionPin")
            {
                classiferID = element.PropertyType;
            }
            else
            {
                classiferID = element.ClassifierID;
            }

            if (classiferID != 0)
            {
                EAAPI.Element classifierElement = repository.GetElementByID(classiferID);

                if (classifierElement != null)
                {
                    result = classifierElement.Name;
                }
            }
            return(result);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        public static EAAPI.Element GetClassifier(this EAAPI.Method method, EAAPI.Repository repository)
        {
            EAAPI.Element result = null;

            int classifierID = 0;

            if (int.TryParse(method.ClassifierID, out classifierID))
            {
                if (classifierID != 0)
                {
                    result = repository.GetElementByID(classifierID);
                }
            }

            return(result);
        }
Ejemplo n.º 5
0
        public static string GetClassifierName(this EAAPI.Method method, EAAPI.Repository repository)
        {
            string result = "";

            int classifierID = 0;

            if (int.TryParse(method.ClassifierID, out classifierID))
            {
                if (classifierID != 0)
                {
                    result = repository.GetElementByID(classifierID).Name;
                }
                else
                {
                    result = method.ReturnType;
                }
            }

            return(result);
        }
Ejemplo n.º 6
0
        public static EAAPI.Element GetClassifier(this EAAPI.Element element, EAAPI.Repository repository)
        {
            EAAPI.Element result = null;

            int classiferID = 0;

            if (element.Type == "Port" || element.Type == "Part" || element.Type == "ActionPin")
            {
                classiferID = element.PropertyType;
            }
            else
            {
                classiferID = element.ClassifierID;
            }
            if (classiferID != 0)
            {
                result = repository.GetElementByID(classiferID);
            }

            return(result);
        }
Ejemplo n.º 7
0
        public static void DeleteConnector(this EAAPI.Repository repository, EAAPI.Connector con)
        {
            EAAPI.Element element = repository.GetElementByID(con.ClientID);

            short index = -1;

            for (short i = 0; i < element.Connectors.Count; i++)
            {
                EAAPI.Connector c = element.Connectors.GetAt(i) as EAAPI.Connector;
                if (c.ConnectorID == con.ConnectorID)
                {
                    index = i;
                    break;
                }
            }

            if (index != -1)
            {
                element.Connectors.Delete(index);
                element.Connectors.Refresh();
            }
        }
Ejemplo n.º 8
0
 public static EAAPI.Element GetParentElement(this EAAPI.Element childElement, EAAPI.Repository repository)
 {
     return(repository.GetElementByID(childElement.ParentID));
 }