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));
        }
Exemple #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()");
        }
 public IEADiagram GetDiagram(string name)
 {
     return(EADiagram.Wrap(_native.Diagrams.GetByName(name)));
 }
Exemple #4
0
 public override IEADiagram GetCurrentDiagram()
 {
     return(EADiagram.Wrap(Native.GetCurrentDiagram()));
 }
Exemple #5
0
 public override IEADiagram GetDiagramByGuid(string guid)
 {
     return(EADiagram.Wrap(Native.GetDiagramByGuid(guid)));
 }
Exemple #6
0
 public override IEADiagram GetDiagramByID(int id)
 {
     return(EADiagram.Wrap(Native.GetDiagramByID(id)));
 }