public ModelEntity.Diagram Create(string name, Diagram diagramType, ModelEntity.Package package, String technologyId) { var diagram = package.EaObject.Diagrams.AddNew(name, diagramType.Type.Name) as EA.Diagram; diagram.StyleEx = String.Format("MDGDgm={0}::{1};", technologyId, diagramType.Name); diagram.Update(); package.EaObject.Diagrams.Refresh(); return(Wrapper.Wrap(diagram)); }
public virtual Option <ModelEntity.Element> Instantiate(ModelEntity.Element classifier, ModelEntity.Package package, IEnumerable <ElementStereotype> stereotypes) { return((from stype in classifier.GetStereotype(stereotypes) from instanceType in stype.InstanceType let e = Create("", instanceType, package) select e) .Select(e => { e.EaObject.ClassifierID = classifier.Id; e.EaObject.Update(); return e; })); }
public virtual ModelEntity.Element Create(String name, ElementStereotype stereotype, ModelEntity.Package package) { var e = package.EaObject.Elements.AddNew(name, stereotype.Type.Name) as EA.Element; e.Stereotype = stereotype.Name; try { e.Update(); } catch (COMException ce) { throw new ApplicationException(e.GetLastError(), ce); } package.EaObject.Elements.Refresh(); return(Wrapper.Wrap(e)); }