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)); }
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); }
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))); }
public override IEAElement GetElementByID(int elementID) { return(EAElement.Wrap(Native.GetElementByID(elementID))); }
public override IEnumerable <IEAElement> GetAllElements() { Collection elements = Native.GetElementSet(null, 0); return((from object element in elements select EAElement.Wrap((Element)element)).ToList()); }
public override IEnumerable <IEAElement> GetSelectedItems() { Collection elements = Native.GetTreeSelectedElements(); return((from object element in elements select EAElement.Wrap((Element)element)).ToList()); }
public override IEAElement GetElementByGUID(string guid) { return(EAElement.Wrap(Native.GetElementByGuid(guid))); }