/// <summary> /// Reloads all variables and data about this model /// </summary> protected void ReloadModelData() { // Clean up any previous data DisposeChildren(); // Can't do much if there is no document if (mBaseObject == null) { return; } // Get the file path FilePath = mBaseObject.GetPathName(); // Get the models type ModelType = (ModelType)mBaseObject.GetType(); // Get the extension Extension = new ModelExtension(mBaseObject.Extension, this); // Get the active configuration ActiveConfiguration = new ModelConfiguration(mBaseObject.IGetActiveConfiguration()); // Get the selection manager SelectionManager = new ModelSelectionManager(mBaseObject.ISelectionManager); // Re-attach event handlers SetupModelEventHandlers(); // Inform listeners ModelInformationChanged(); }
/// <summary> /// Reloads all variables and data about this model /// </summary> protected void ReloadModelData() { // Clean up any previous data DisposeAllReferences(); // Can't do much if there is no document if (BaseObject == null) { return; } // Get the file path FilePath = BaseObject.GetPathName(); // Get the models type ModelType = (ModelType)BaseObject.GetType(); // Get the extension Extension = new ModelExtension(BaseObject.Extension, this); // Get the active configuration ActiveConfiguration = new ModelConfiguration(BaseObject.IGetActiveConfiguration()); // Get the selection manager SelectionManager = new SelectionManager(BaseObject.ISelectionManager); // Set drawing access Drawing = IsDrawing ? new DrawingDocument((DrawingDoc)BaseObject) : null; // Set part access Part = IsPart ? new PartDocument((PartDoc)BaseObject) : null; // Set assembly access Assembly = IsAssembly ? new AssemblyDocument((AssemblyDoc)BaseObject) : null; // Inform listeners ModelInformationChanged(); }