Пример #1
0
        public bool IsDecisionViewPackage()
        {
            IEAElement underlyingElement = EAElement.Wrap(_native.Element);
            string     value             = underlyingElement.GetTaggedValueByName(EATaggedValueKeys.DecisionViewPackage);

            return(value != null && value.Equals("true"));
        }
Пример #2
0
        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));
        }
Пример #3
0
        public static IEAElement Wrap(EventProperties properties)
        {
            dynamic   elementId = EAUtilities.ParseToInt32(properties.Get(EAEventPropertyKeys.ElementId).Value, -1);
            EAElement element   = null;

            if (elementId > 0)
            {
                element = EARepository.Instance.GetElementByID(elementId);
            }
            return(element);
        }
Пример #4
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()");
        }
Пример #5
0
 public IEAElement AddElement(string name, string type)
 {
     return(EAElement.Wrap(_native.Elements.AddNew(name, type)));
 }
Пример #6
0
 public override IEAElement GetElementByID(int elementID)
 {
     return(EAElement.Wrap(Native.GetElementByID(elementID)));
 }
Пример #7
0
        public override IEnumerable <IEAElement> GetAllElements()
        {
            Collection elements = Native.GetElementSet(null, 0);

            return((from object element in elements select EAElement.Wrap((Element)element)).ToList());
        }
Пример #8
0
        public override IEnumerable <IEAElement> GetSelectedItems()
        {
            Collection elements = Native.GetTreeSelectedElements();

            return((from object element in elements select EAElement.Wrap((Element)element)).ToList());
        }
Пример #9
0
 public override IEAElement GetElementByGUID(string guid)
 {
     return(EAElement.Wrap(Native.GetElementByGuid(guid)));
 }