private void Unload() { if (this.projectFontFamilies != null) { this.projectFontFamilies.CollectionChanged -= new NotifyCollectionChangedEventHandler(this.projectFontFamilies_CollectionChanged); this.projectFontFamilies = (ObservableCollection <IProjectFont>)null; } SelectedElementsObjectSet elementsObjectSet = this.sceneNodeObjectSet as SelectedElementsObjectSet; if (elementsObjectSet != null) { elementsObjectSet.ViewModelChanged -= new EventHandler(this.objectSet_ViewModelChanged); } this.sceneNodeObjectSet = (SceneNodeObjectSet)null; this.projectContext = (IProjectContext)null; }
private void Rebuild() { this.Unload(); SceneNodePropertyValue nodePropertyValue = this.DataContext as SceneNodePropertyValue; if (nodePropertyValue == null) { return; } this.sceneNodeObjectSet = ((SceneNodeProperty)nodePropertyValue.get_ParentProperty()).SceneNodeObjectSet; this.projectContext = this.sceneNodeObjectSet.ProjectContext; this.projectFontFamilies = this.projectContext.ProjectFonts; this.projectFontFamilies.CollectionChanged += new NotifyCollectionChangedEventHandler(this.projectFontFamilies_CollectionChanged); this.fontFamilyEditor.FontFamilies = FontFamilyValueEditor.GetFontFamilies(this.sceneNodeObjectSet); SelectedElementsObjectSet elementsObjectSet = this.sceneNodeObjectSet as SelectedElementsObjectSet; if (elementsObjectSet == null) { return; } elementsObjectSet.ViewModelChanged += new EventHandler(this.objectSet_ViewModelChanged); }