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 override IEAPackage GetPackageByGUID(string guid) { return(EAPackage.Wrap(Native.GetPackageByGuid(guid))); }
public override IEAPackage GetPackageByID(int id) { return(EAPackage.Wrap(Native.GetPackageByID(id))); }
public override IEAPackage GetPackageFromRootByName(string name) { return(EAPackage.Wrap(Root.Packages.GetByName(name))); }