public void Refresh(ITypeResolver typeResolver, IInstanceBuilderFactory factory)
 {
     foreach (ProjectTypeInstanceBuilderHelper.InstanceBuilderInfo creator in this.creators)
     {
         IType type = typeResolver.ResolveType(creator.ProjectType);
         if (!creator.AddIfMissing(type.RuntimeType))
         {
             continue;
         }
         factory.Register(creator.CreateDelegate(type));
     }
 }
Exemplo n.º 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));
        }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.viewNodeManager != null)
         {
             this.viewNodeManager.DisposeInternal();
             this.viewNodeManager = null;
         }
         this.effectManager          = null;
         this.instanceBuilderFactory = null;
         this.metadataFactory        = null;
         this.serializationContext   = null;
         this.documentRootResolver   = null;
         this.viewRootResolver       = null;
         this.parentContext          = null;
         this.nameScope         = null;
         this.textBufferService = null;
         this.containerRoot     = null;
         if (this.instanceDictionary != null)
         {
             this.instanceDictionary.Clear();
         }
         if (this.exceptionDictionary != null)
         {
             this.exceptionDictionary.Clear();
         }
         if (this.warningDictionary != null)
         {
             this.warningDictionary.Clear();
         }
         if (this.userControlInstances != null)
         {
             foreach (ViewNode userControlInstance in this.userControlInstances)
             {
                 userControlInstance.Dispose();
             }
             this.userControlInstances.Clear();
         }
     }
 }
 protected InstanceBuilderContextBase(IPlatform platform, IDocumentContext documentContext, IDocumentRootResolver documentRootResolver, IViewRootResolver viewRootResolver, ITypeMetadataFactory metadataFactory, INameScope nameScope, IInstanceBuilderContext parentContext, bool useShadowProperties, ITextBufferService textBufferService, DocumentNode alternateSiteNode)
 {
     this.documentContext                   = documentContext;
     this.platform                          = platform;
     this.effectManager                     = platform.EffectManager;
     this.instanceBuilderFactory            = platform.InstanceBuilderFactory;
     this.documentRootResolver              = documentRootResolver;
     this.viewRootResolver                  = viewRootResolver;
     this.metadataFactory                   = metadataFactory;
     this.AllowPostponingResourceEvaluation = true;
     this.viewNodeManager                   = this.platform.Create();
     this.viewNodeManager.Initialize(this);
     this.userControlInstances = new HashSet <ViewNode>();
     this.currentlyInstantiatingUserControlPreviews = new HashSet <string>();
     this.instanceDictionary  = this.platform.CreateInstanceDictionary(this.viewNodeManager);
     this.exceptionDictionary = new Microsoft.Expression.DesignModel.InstanceBuilders.ExceptionDictionary(this.viewNodeManager);
     this.warningDictionary   = new Microsoft.Expression.DesignModel.InstanceBuilders.WarningDictionary(this.viewNodeManager);
     this.nameScope           = nameScope;
     this.useShadowProperties = useShadowProperties;
     this.shouldRegisterInstantiatedElements = true;
     this.parentContext     = parentContext;
     this.textBufferService = textBufferService;
     this.alternateSiteNode = alternateSiteNode;
 }