public bool IsDecisionViewPackage()
        {
            IEAElement underlyingElement = EAElement.Wrap(_native.Element);
            string     value             = underlyingElement.GetTaggedValueByName(EATaggedValueKeys.DecisionViewPackage);

            return(value != null && value.Equals("true"));
        }
        public IEAElement CreateElement(string name, string stereotype, string type)
        {
            Element newElement = _native.Elements.AddNew(name, type);

            newElement.Stereotype = stereotype;
            newElement.Update();
            _native.Elements.Refresh();
            EARepository.Instance.RefreshModelView(_native.PackageID);
            return(EAElement.Wrap(newElement));
        }
Exemple #3
0
        public override T GetContextObject <T>()
        {
            dynamic obj   = Native.GetContextObject();
            Type    typeT = typeof(T);

            if (typeT == typeof(IEAElement))
            {
                var nativeElement = obj as Element;
                if (nativeElement != null)
                {
                    dynamic element = EAElement.Wrap(nativeElement);
                    return(element);
                }
                return(default(T));
            }
            if (typeT == typeof(IEAPackage))
            {
                var nativePackage = obj as Package;
                if (nativePackage != null)
                {
                    dynamic element = EAPackage.Wrap(nativePackage);
                    return(element);
                }
                return(default(T));
            }
            if (typeT == typeof(IEADiagram))
            {
                var nativeDiagram = obj as Diagram;
                if (nativeDiagram != null)
                {
                    dynamic element = EADiagram.Wrap(nativeDiagram);
                    return(element);
                }
                return(default(T));
            }

            throw new NotSupportedException("Type (" + typeT.Name + ") not supported by GetContextObject()");
        }
 public IEAElement AddElement(string name, string type)
 {
     return(EAElement.Wrap(_native.Elements.AddNew(name, type)));
 }
Exemple #5
0
 public override IEAElement GetElementByID(int elementID)
 {
     return(EAElement.Wrap(Native.GetElementByID(elementID)));
 }
Exemple #6
0
        public override IEnumerable <IEAElement> GetAllElements()
        {
            Collection elements = Native.GetElementSet(null, 0);

            return((from object element in elements select EAElement.Wrap((Element)element)).ToList());
        }
Exemple #7
0
        public override IEnumerable <IEAElement> GetSelectedItems()
        {
            Collection elements = Native.GetTreeSelectedElements();

            return((from object element in elements select EAElement.Wrap((Element)element)).ToList());
        }
Exemple #8
0
 public override IEAElement GetElementByGUID(string guid)
 {
     return(EAElement.Wrap(Native.GetElementByGuid(guid)));
 }