Пример #1
0
        public IEADiagram CreateDiagram(string name, string stereotype, string type)
        {
            Diagram newDiagram = _native.Diagrams.AddNew(name, type);

            newDiagram.Stereotype = stereotype;
            newDiagram.Update();
            _native.Diagrams.Refresh();
            EARepository.Instance.RefreshModelView(_native.PackageID);
            return(EADiagram.Wrap(newDiagram));
        }
Пример #2
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()");
        }
Пример #3
0
 public IEADiagram GetDiagram(string name)
 {
     return(EADiagram.Wrap(_native.Diagrams.GetByName(name)));
 }
Пример #4
0
 public override IEADiagram GetCurrentDiagram()
 {
     return(EADiagram.Wrap(Native.GetCurrentDiagram()));
 }
Пример #5
0
 public override IEADiagram GetDiagramByGuid(string guid)
 {
     return(EADiagram.Wrap(Native.GetDiagramByGuid(guid)));
 }
Пример #6
0
 public override IEADiagram GetDiagramByID(int id)
 {
     return(EADiagram.Wrap(Native.GetDiagramByID(id)));
 }