当前位置: 首页>>代码示例>>C#>>正文


C# EA类代码示例

本文整理汇总了C#中EA的典型用法代码示例。如果您正苦于以下问题:C# EA类的具体用法?C# EA怎么用?C# EA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EA类属于命名空间,在下文中一共展示了EA类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: addTaggedValue

 public static void addTaggedValue(string name, string value, EA.Attribute attr)
 {
     EA.AttributeTag at = (EA.AttributeTag)attr.TaggedValues.AddNew(name, "string");
     at.Value = value;
     at.Update();
     attr.TaggedValues.Refresh();
 }
开发者ID:NCIP,项目名称:cagrid-grid-incubation,代码行数:7,代码来源:EAUtil.cs

示例2: handleSynchronizationAdditions

 /// <summary>
 /// method handles item creations during synchronization
 /// </summary>
 /// <param name="itemCreation">instance of item creation carrying information about item creation</param>
 /// <param name="repository">EA repository</param>
 /// <returns>GUID of new item</returns>
 public string handleSynchronizationAdditions(ItemCreation itemCreation, EA.Repository repository)
 {
     string GUID = "";
     if (itemCreation.elementType == 3)
     {
         GUID = synchronizationAdditions.addPackage(repository, itemCreation.packageGUID, itemCreation.name, itemCreation.author);
     }
     else if (itemCreation.elementType >= 50 && itemCreation.elementType < 70)
     {
         GUID = synchronizationAdditions.addDiagram(repository, itemCreation.parentGUID, itemCreation.packageGUID,
             itemCreation.elementType, itemCreation.name, itemCreation.author);
     }
     else if (itemCreation.elementType < 50)
     {
         GUID = synchronizationAdditions.addElement(repository, itemCreation.parentGUID, itemCreation.packageGUID,
             itemCreation.coordinates, itemCreation.elementType, itemCreation.name, itemCreation.author);
     }
     else if (itemCreation.elementType >= 70 && itemCreation.elementType <= 79)
     {
         GUID = synchronizationAdditions.addConnector(repository, itemCreation.srcGUID, itemCreation.targetGUID, itemCreation.name, itemCreation.elementType);
     }
     else if (itemCreation.elementType == 90)
     {
         GUID = synchronizationAdditions.addAttribute(repository, itemCreation.parentGUID, itemCreation.name, itemCreation.coordinates);
     }
     else if (itemCreation.elementType == 700)
     {
         synchronizationAdditions.addDiagramObject(repository, itemCreation.itemGUID, itemCreation.diagramGUID, itemCreation.coordinates);
         GUID = "";
     }
     return GUID;
 }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:38,代码来源:Synchronization.cs

示例3: LoadFromRepository

        public void LoadFromRepository(EA.Repository repository)
        {
            element = EAHelper.GetCurrentElement(repository);

            if (element != null)
            {
                field = element.TaggedValuesEx.GetByName("Markdown");

                if(field == null)
                {
                    field = element.TaggedValuesEx.AddNew("Markdown", "TaggedValue");
                    field.Value = "<memo>";
                    field.Update();
                }

                style = element.TaggedValuesEx.GetByName("MarkdownStyle");
                if(style == null)
                {
                    style = element.TaggedValuesEx.AddNew("MarkdownStyle", "TaggedValue");
                    style.Value = ((MarkdownStyle)this.toolstripStyleBox.SelectedItem).CSSLink;
                    style.Update();
                }

                skin = element.TaggedValuesEx.GetByName("PrettifySkin");
                if (skin == null)
                {
                    skin = element.TaggedValuesEx.AddNew("PrettifySkin", "TaggedValue");
                    skin.Value = this.toolStripSkinBox.SelectedItem.ToString();
                    skin.Update();
                }
            }

            this.markdownTextBox.Text = field.Notes;
            //UpdateWebBrowser();
        }
开发者ID:PlasmaTrout,项目名称:EAPowerTools,代码行数:35,代码来源:MarkdownNotesControl.cs

示例4: EA_FileOpen

 public override void EA_FileOpen(EA.Repository Repository)
 {
     // initialize the model
     this.model = new TSF_EA.Model(Repository);
     // indicate that we are now fully loaded
     this.fullyLoaded = true;
 }
开发者ID:GeertBellekens,项目名称:Enterprise-Architect-Toolpack,代码行数:7,代码来源:EAMappingAddin.cs

示例5: GetElementFromContextObject

 /// <summary>
 /// Get element from Context element. Possible inputs are: Attribute, Operation, Element, Package
 /// </summary>
 /// <param name="rep"></param>
 /// <returns></returns>
 public static EA.Element GetElementFromContextObject(EA.Repository rep)  {
     EA.Element el = null;
     EA.ObjectType objectType = rep.GetContextItemType();
     switch (objectType)
     {
         case ObjectType.otAttribute:
             var a = (EA.Attribute)rep.GetContextObject();
             el = rep.GetElementByID(a.ParentID);
             break;
         case ObjectType.otMethod:
             var m = (Method)rep.GetContextObject();
             el = rep.GetElementByID(m.ParentID);
             break;
         case ObjectType.otElement:
             el = (EA.Element)rep.GetContextObject();
             break;
         case ObjectType.otPackage:
             EA.Package pkg  = rep.GetContextObject();
             el = rep.GetElementByGuid(pkg.PackageGUID);
             break;
         case ObjectType.otNone:
             EA.Diagram dia = rep.GetCurrentDiagram();
             if (dia?.SelectedObjects.Count == 1)
             {
                 var objSelected = (EA.DiagramObject)dia.SelectedObjects.GetAt(0);
                 el = rep.GetElementByID(objSelected.ElementID);
             }
             break;
         default:
             MessageBox.Show(@"No Element, Attribute, Operation, Package selected");
             break;
      }
     return el;
 }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:39,代码来源:Util.cs

示例6: EA_MenuClick

        public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName)
        {
            EAQueryServiceForm eaq;
            //DataElementCreationForm der;
            switch (ItemName)
            {
                case ROOT_MENU:
                //case "&Open Query Service Panel":

                    eaq = new EAQueryServiceForm();
                    eaq.eaQueryServiceControl.m_Repository = Repository;
                    eaq.eaQueryServiceControl.m_IncludeElements = false;
                    eaq.Show();
                    break;
                    /*
                case "&Create CDE":
                    der = new DataElementCreationForm();
                    der.m_Repository = Repository;
                    der.Show();
                    break;
                    */
                /*
                case "&View Selected Element Details":
                    ShowElementDetails(Repository);
                    break;
                 */
            }
        }
开发者ID:NCIP,项目名称:cagrid-grid-incubation,代码行数:28,代码来源:Main.cs

示例7: addConnector

        /// <summary>
        /// method adds a new connector between source and target element
        /// </summary>
        /// <param name="Repository">EA repository</param>
        /// <param name="srcGUID">GUID of source element</param>
        /// <param name="targetGUID">GUID of target element</param>
        /// <param name="name">name of new connector</param>
        /// <param name="elementType">type of new connector</param>
        /// <returns>GUID of new connector</returns>
        public string addConnector(EA.Repository Repository, string srcGUID, string targetGUID, string name, int elementType)
        {
            EA.Element source = (EA.Element)Repository.GetElementByGuid(srcGUID);
            EA.Element target = (EA.Element)Repository.GetElementByGuid(targetGUID);

            EA.Connector newConnector = (EA.Connector)source.Connectors.AddNew(name, getConnectorType(elementType));

            if (elementType == 73)
            {
                newConnector.Subtype = "Includes";
                newConnector.Stereotype = "include";
            }
            else if (elementType == 74)
            {
                newConnector.Subtype = "Extends";
                newConnector.Stereotype = "extend";
            }

            newConnector.SupplierID = target.ElementID;
            newConnector.Update();
            source.Connectors.Refresh();

            BPAddIn.synchronizationWindow.addToList("Addition of " + itemTypes.getElementTypeInEnglish(elementType) + " '" + name +
                   "' between element '" + source.Name + "' and element '" + target.Name + "'");

            return newConnector.ConnectorGUID;
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:36,代码来源:SynchronizationAdditions.cs

示例8: EA_GetMenuState

 /// <summary>
 /// Called once Menu has been opened to see what menu items should active.
 /// </summary>
 /// <param name="Repository">the repository</param>
 /// <param name="Location">the location of the menu</param>
 /// <param name="MenuName">the name of the menu</param>
 /// <param name="ItemName">the name of the menu item</param>
 /// <param name="IsEnabled">boolean indicating whethe the menu item is enabled</param>
 /// <param name="IsChecked">boolean indicating whether the menu is checked</param>
 public override void EA_GetMenuState(EA.Repository Repository, string Location, string MenuName, string ItemName, ref bool IsEnabled, ref bool IsChecked)
 {
     if (IsProjectOpen(Repository))
     {
         switch (ItemName)
         {
             // define the state of the hello menu option
             case menuHello:
                 IsEnabled = shouldWeSayHello;
                 break;
             // define the state of the goodbye menu option
             case menuGoodbye:
                 IsEnabled = !shouldWeSayHello;
                 break;
             // there shouldn't be any other, but just in case disable it.
             default:
                 IsEnabled = false;
                 break;
         }
     }
     else
     {
         // If no open project, disable all menu options
         IsEnabled = false;
     }
 }
开发者ID:hugelsb,项目名称:Enterprise-Architect-Add-in-Framework,代码行数:35,代码来源:MyAddinClass.cs

示例9: XisListItem

 public XisListItem(EA.Repository repository, EA.Diagram diagram,
     XisList parent, string name, string onTap = null, string onLongTap = null)
     : base(repository, parent)
 {
     Element = XISMobileHelper.CreateXisListItem(parent.Element, name, onTap, onLongTap);
     parent.Items.Add(this);
 }
开发者ID:theedward,项目名称:xis-mobile,代码行数:7,代码来源:XisListItem.cs

示例10: XisMenuGroup

 public XisMenuGroup(EA.Repository repository, EA.Diagram diagram, XisMenu parent, string name)
     : base(repository, parent)
 {
     Element = XISMobileHelper.CreateXisMenuGroup(parent.Element, name);
     Items = new List<XisMenuItem>();
     parent.Groups.Add(this);
 }
开发者ID:theedward,项目名称:xis-mobile,代码行数:7,代码来源:XisMenuGroup.cs

示例11: XisList

 public XisList(EA.Repository repository, EA.Diagram diagram,
     XisInteractionSpace parent, string name, string searchBy = null, string orderBy = null)
     : base(repository, parent)
 {
     Element = XISMobileHelper.CreateXisList(parent.Element, name, searchBy, orderBy);
     Items = new List<XisListItem>();
 }
开发者ID:theedward,项目名称:xis-mobile,代码行数:7,代码来源:XisList.cs

示例12: UpdateActionPinForElement

        //public static bool updateActionPin(EA.Repository rep, EA.Element el) {
        //    // get classifier (operation)
        //    EA.Method m = Util.getOperationFromCallAction(rep, el);

        //    // update action pins
        //    if (m != null)
        //    {
        //        foreach (EA.Parameter par in m.Parameters)
        //        {
        //            updateActionPinParameter(rep, m, el, par);
        //        }
        //    }
        //    return true;
        //}

        public static bool UpdateActionPinForElement(EA.Repository rep, EA.Element el1)
        {
            if (el1.Type == "Action")
            {
                UpdateActionPinParameter(rep, el1);
                return true;
            }
            if (el1.Type == "Class" | el1.Type == "Interface")
            {
                return true;
            }
            foreach (EA.Element el in el1.Elements)
            {   // update parameter
                if (el.Type == "Action")
                {
                    UpdateActionPinParameter(rep, el);

                }
                if (el.Type == "Activity")
                {
                    UpdateActionPinForElement(rep, el);
                }
            }

            return true;
        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:41,代码来源:ActionPin.cs

示例13: FindAndReplaceItem

        public FindAndReplaceItem( EA.Repository rep, string GUID)
        {
            _GUID = GUID;
            _countChanges = 0;
            _isUpdated = false;

        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:7,代码来源:FindAndReplaceItem.cs

示例14: load

 public override void load(EA.Repository rep)
 {
     _Name = _dia.Name;
     _Description = _dia.Notes;
     _Stereotype = _dia.StereotypeEx;
  
 }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:7,代码来源:FindAndReplaceItemDiagram.cs

示例15: ReportException

 public ReportException(String message, int code, EA.Repository r, byte b)
 {
     this.message = message;
     this.code = code;
     this.r = r;
     this.p = b;
 }
开发者ID:romanLetun,项目名称:EAReport,代码行数:7,代码来源:EAReport.cs


注:本文中的EA类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。