Beispiel #1
0
        public static INamespace Transform2Meta(EPackage package, Action <IEPackage, INamespace> additionalPackageRegistry = null)
        {
            var model       = new Model();
            var context     = new TransformationContext(ecore2Meta);
            var rootPackage = TransformationEngine.Transform <IEPackage, INamespace>(package, context);

            model.RootElements.Add(rootPackage);
            Uri modelUri;

            if (Uri.TryCreate(package.NsURI, UriKind.Absolute, out modelUri))
            {
                model.ModelUri = modelUri;
            }
            if (additionalPackageRegistry != null)
            {
                foreach (var packageT in context.Trace.TraceAllIn(ecore2Meta.Rule <Ecore2MetaTransformation.EPackage2Namespace>()))
                {
                    var pack = packageT.GetInput(0) as IEPackage;
                    if (pack != package && pack.ESuperPackage == null)
                    {
                        additionalPackageRegistry(pack, (INamespace)packageT.Output);
                    }
                }
            }
            return(rootPackage);
        }
Beispiel #2
0
        public static INamespace Transform2Meta(EPackage package)
        {
            var model       = new Model();
            var rootPackage = TransformationEngine.Transform <IEPackage, INamespace>(package, ecore2Meta);

            model.RootElements.Add(rootPackage);
            Uri modelUri;

            if (Uri.TryCreate(package.NsURI, UriKind.Absolute, out modelUri))
            {
                model.ModelUri = modelUri;
            }
            return(rootPackage);
        }
Beispiel #3
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public EPackageReferencedElementsCollection(EPackage parent)
 {
     this._parent = parent;
 }
Beispiel #4
0
 /// <summary>
 /// Creates a new instance
 /// </summary>
 public EPackageChildrenCollection(EPackage parent)
 {
     this._parent = parent;
 }