//event handler for opening project state private void ProjectOpenedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e) { //if modeling is in the list of packed plugins, go unpack if (e.PackedPluginStates.ContainsKey(strPanelKey)) { IDictionary <string, object> dictPlugin = e.PackedPluginStates[strPanelKey]; //repopulate plugin Complete flags from saved project boolComplete = (bool)dictPlugin["Complete"]; //check to see if there already is a PLS model open, if so, close it before opening a saved project if ((VisiblePlugin) && (Complete)) { Hide(); } //make model being open active plugin if ((bool)dictPlugin["Visible"]) { Show(); } innerIronPythonControl.UnpackProjectState(e.PackedPluginStates[strPanelKey]); } else { //Set this plugin to an empty state. Activate(); } }
//event handler for opening project state private void ProjectOpenedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e) { if (e.PackedPluginStates.ContainsKey(strPanelKey)) { IDictionary <string, object> dictPlugin = e.PackedPluginStates[strPanelKey]; //repopulate plugin complete flags from saved project boolComplete = (bool)dictPlugin["Complete"]; //check to see if there already is a prediction, if so, close it and open the saved project if (VisiblePlugin) { Hide(); } //make prediction active plugin if ((bool)dictPlugin["Visible"]) { Show(); } //Unpack the state of this plugin. _frmIPyPred.UnpackState(e.PackedPluginStates[strPanelKey]); } else { Activate(); //Set this plugin to an empty state. } }
//event handler for saving project state private void ProjectSavedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e) { //go pack state, add complete and visible, and add to dictionary of plugins IDictionary <string, object> packedState = innerIronPythonControl.PackProjectState(); packedState.Add("Complete", boolComplete); packedState.Add("Visible", boolVisible); e.PackedPluginStates.Add(strPanelKey, packedState); }
//event listener for saving packed state of datasheet private void ProjectSavedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e) { //call packState, returing packed state of plugin IDictionary <string, object> packedState = _frmDatasheet.PackState(); //add complete and visible flags to dictionary packedState.Add("Complete", boolComplete); packedState.Add("Visible", boolVisible); //add packed state to dictionary of all packed states for saving e.PackedPluginStates.Add(strPanelKey, packedState); }
//event handler for saving project state private void ProjectSavedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e) { IDictionary <string, object> packedState = _frmIPyPred.PackState(); if (packedState != null) { packedState.Add("Complete", boolComplete); packedState.Add("Visible", boolVisible); e.PackedPluginStates.Add(strPanelKey, packedState); } }
//Unpack the state of this plugin. private void ProjectOpenedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e) { if (e.PackedPluginStates.ContainsKey(strPanelKey)) { IDictionary <string, object> dictPlugin = e.PackedPluginStates[strPanelKey]; //Repopulate plugin Complete flag with saved project boolComplete = (bool)dictPlugin["Complete"]; //check to see if there already is a datasheet open, if so, close it before opening a saved project if (boolVisible) { Hide(); } //then show the opening project datasheet if ((bool)dictPlugin["Visible"]) { Show(); //enable the buttons for opening project if (boolComplete) { btnComputeAO.Enabled = true; btnGoToModeling.Enabled = true; btnManipulate.Enabled = true; btnTransform.Enabled = true; } } //unpack it _frmDatasheet.UnpackState(e.PackedPluginStates[strPanelKey]); } else { //Set this plugin to an empty state. Activate(); } }