Beispiel #1
0
        private bool SynchronizeUmlItemTags(UML.Classes.Interfaces.Interface interfaceItem, ref string TagName, ref string TagValue, ref string TagNotes)
        {
            if (HasSterotype(C_ExtStereotypes.funptr, interfaceItem.stereotypes))
            {
                FunptrInterface funptr = new FunptrInterface(interfaceItem);
                string          defaultTypeSynonymsTag = interfaceItem.name;
                EA.Element      eaElem         = (interfaceItem as UTF_EA.ElementWrapper).WrappedElement;
                bool            changedElement = false;

                // Synchronize tagged values
                for (short i = 0; i < eaElem.TaggedValues.Count; ++i)
                {
                    EA.TaggedValue currentTag = eaElem.TaggedValues.GetAt(i) as EA.TaggedValue;
                    bool           changedTag = false;
                    switch (currentTag.Name)
                    {
                    case C_ExtTags.typeSynonyms:
                        if (currentTag.Value != defaultTypeSynonymsTag)
                        {
                            currentTag.Value = defaultTypeSynonymsTag;
                            changedTag       = true;
                        }
                        break;

                    case C_ExtTags.static_:
                        if ((currentTag.Value == "false") &&
                            !((interfaceItem.owner is UML.Classes.Kernel.Class) ||
                              (interfaceItem.owner is UML.Classes.Interfaces.Interface)))
                        {
                            TagValue   = "true";
                            changedTag = true;
                        }
                        break;
                    }
                    if (changedTag)
                    {
                        currentTag.Update();
                        eaElem.TaggedValues.Refresh();
                        changedElement = true;
                    }
                }

                // Synchronize element Alias
                string alias = funptr.GetAliasFromTags(TagName, TagValue);
                if (eaElem.Alias != alias)
                {
                    eaElem.Alias   = alias;
                    changedElement = true;
                }

                if (changedElement)
                {
                    eaElem.Update();
                }
                return(changedElement);
            }

            return(false);
        }
Beispiel #2
0
 private bool IsTrackedUmlItem(UML.UMLItem umlItem)
 {
     if (umlItem is UML.Classes.Kernel.Class)
     {
         UML.Classes.Kernel.Class classItem = umlItem as UML.Classes.Kernel.Class;
     }
     else if (umlItem is UML.Classes.Interfaces.Interface)
     {
         UML.Classes.Interfaces.Interface interfaceItem = umlItem as UML.Classes.Interfaces.Interface;
         if (HasSterotype(C_ExtStereotypes.funptr, interfaceItem.stereotypes))
         {
             return(true);
         }
     }
     else if (umlItem is UML.Classes.Kernel.Operation)
     {
         UML.Classes.Kernel.Operation opItem = umlItem as UML.Classes.Kernel.Operation;
         if (HasSterotype(C_ExtStereotypes.funptr, opItem.stereotypes))
         {
             return(true);
         }
     }
     return(false);
 }
 public FunptrInterface(UML.Classes.Interfaces.Interface funptrInterface)
 {
     funptrInterface_ = funptrInterface;
 }
 public FunptrInterface(UML.Classes.Interfaces.Interface funptrInterface)
 {
     funptrInterface_ = funptrInterface;
 }