示例#1
0
        public IPlatform CreatePlatform(IPlatformRuntimeContext platformRuntimeContext, IPlatformReferenceContext platformReferenceContext, IPlatformService platformService, IPlatformHost platformHost)
        {
            IPlatform platform;

            if (platformReferenceContext == null)
            {
                if (this.defaultPlatformReferenceContext == null)
                {
                    this.defaultPlatformReferenceContext = new DefaultPlatformReferenceContext(this.RuntimeFramework);
                }
                platformReferenceContext = this.defaultPlatformReferenceContext;
            }
            using (IEnumerator <IPlatform> enumerator = this.platformTable.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    IPlatform current = enumerator.Current;
                    if (!platformReferenceContext.Equals(current.Metadata.ReferenceContext))
                    {
                        continue;
                    }
                    this.platformTable[current] = this.platformTable[current] + 1;
                    platform = current;
                    return(platform);
                }
                PlatformBase platformBase = this.CreatePlatformInternal(platformRuntimeContext, platformReferenceContext, platformService, platformHost);
                platformBase.Initialize();
                platformBase.PlatformHost = platformHost;
                RuntimeGeneratedTypesHelper.RegisterRuntimeAssemblies(platformBase.Metadata);
                this.OnPlatformCreated(new PlatformEventArgs(platformBase));
                this.platformTable.Add(platformBase, 1);
                return(platformBase);
            }
            return(platform);
        }
示例#2
0
        protected PlatformBase()
        {
            PlatformBase platformBase = this;

            this.documentNodeBuilderFactory = new Microsoft.Expression.DesignModel.NodeBuilders.DocumentNodeBuilderFactory(this, new Action(platformBase.RegisterNodeBuilders));
            PlatformBase platformBase1 = this;

            this.documentNodeChildBuilderFactory = new Microsoft.Expression.DesignModel.NodeBuilders.DocumentNodeChildBuilderFactory(new Action(platformBase1.RegisterNodeChildBuilders));
            PlatformBase platformBase2 = this;

            this.documentNodePropertyBuilderFactory = new Microsoft.Expression.DesignModel.NodeBuilders.DocumentNodePropertyBuilderFactory(new Action(platformBase2.RegisterNodePropertyBuilders));
            PlatformBase platformBase3 = this;

            this.instanceBuilderFactory = new Microsoft.Expression.DesignModel.InstanceBuilders.InstanceBuilderFactory(new Action(platformBase3.RegisterInstanceBuilders));
            PlatformBase platformBase4 = this;

            this.viewObjectFactory = new Microsoft.Expression.DesignModel.ViewObjects.ViewObjectFactory(new Action(platformBase4.RegisterViewObjects));
        }