示例#1
0
        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));
        }
示例#2
0
 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;
     }));
 }
示例#3
0
        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));
        }