Exemplo n.º 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);
        }
Exemplo n.º 2
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;
        }