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; }
public CrossDocumentUpdateContext(IViewRootResolver viewRootResolver) { this.viewRootResolver = viewRootResolver; }
public StandaloneInstanceBuilderContext(IDocumentContext documentContext, IViewRootResolver viewRootResolver, ITextBufferService textBufferService) : base(((IProjectContext)documentContext.TypeResolver).Platform, documentContext, (IDocumentRootResolver)documentContext.TypeResolver, viewRootResolver, ((IProjectContext)documentContext.TypeResolver).MetadataFactory, (INameScope) new NameScope(), (IInstanceBuilderContext)null, true, textBufferService, (DocumentNode)null) { this.overlayLayer = ((IProjectContext)documentContext.TypeResolver).Platform.CreateOverlayLayer(); this.projectContext = (IProjectContext)documentContext.TypeResolver; }