コード例 #1
0
ファイル: DatasheetPlugIn.cs プロジェクト: wrbrooks/VB3
 //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);
 }
コード例 #2
0
ファイル: DatasheetPlugIn.cs プロジェクト: wrbrooks/VB3
 //listen to other plugin's broadcasting their changes
 private void BroadcastStateListener(object sender, VBCommon.PluginSupport.BroadCastEventArgs e)
 {
 }
コード例 #3
0
ファイル: DatasheetPlugIn.cs プロジェクト: wrbrooks/VB3
        //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();
            }
        }
コード例 #4
0
ファイル: IpyPredictionPlugin.cs プロジェクト: wrbrooks/VB3
        //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.
            }
        }
コード例 #5
0
ファイル: IpyPredictionPlugin.cs プロジェクト: wrbrooks/VB3
        //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);
            }
        }
コード例 #6
0
ファイル: IPyModelingPlugIn.cs プロジェクト: wrbrooks/VB3
        //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);
        }
コード例 #7
0
ファイル: IpyPredictionPlugin.cs プロジェクト: wrbrooks/VB3
 //event listener for plugin broadcasting changes
 private void BroadcastStateListener(object sender, VBCommon.PluginSupport.BroadCastEventArgs e)
 {
     //listen to others broadcast..receiving something
     if (((IPlugin)sender).PluginType == Globals.PluginType.Modeling)
     {
         _frmIPyPred.SetModel(e.PackedPluginState);
     }
     if (boolComplete)
         _frmIPyPred.ClearDataGridViews();
 }
コード例 #8
0
ファイル: IPyModelingPlugIn.cs プロジェクト: wrbrooks/VB3
        //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();
            }
        }
コード例 #9
0
ファイル: IPyModelingPlugIn.cs プロジェクト: wrbrooks/VB3
 //event listener for plugin broadcasting changes
 private void BroadcastStateListener(object sender, VBCommon.PluginSupport.BroadCastEventArgs e)
 {
     //if datasheet updated itself, set data with changes, passing datasheet's plugin packed state
     if (((IPlugin)sender).PluginType == Globals.PluginType.Datasheet)
     {
         innerIronPythonControl.SetData(e.PackedPluginState);
     }
     //if datasheet changes were made after a model has been run, clear the model
     if (boolComplete && ((IPlugin)sender).PluginType == Globals.PluginType.Datasheet)
     {
         innerIronPythonControl.Clear();
         MakeActive();
     }
 }
コード例 #10
0
ファイル: VBProjectManager.cs プロジェクト: wrbrooks/VB3
        //listen to plugin's broadcast in order to update other plugins
        private void BroadcastStateListener(object sender, VBCommon.PluginSupport.BroadCastEventArgs e)
        {
            string strPluginType = (((IPlugin)sender).PluginType).ToString();
            //if datasheet is broadcasting any changes
            if (strPluginType == "Datasheet")
            {
                //find modeling plugin, needs to show itself once datasheet broadcasts itself with complete flag raised
                foreach (DotSpatial.Extensions.IExtension ex in App.Extensions)
                {
                    IPlugin plugin = (IPlugin)ex;

                    if (plugin.PluginType.ToString() == "Modeling")
                        //already visible, just update not show again
                        if (plugin.VisiblePlugin)
                            return;
                        //if datasheet is complete, show modeling
                        else if (((IPlugin)sender).Complete)
                            plugin.Show();
                }
                //if modeling is broadcasting itself
            }
            else if (strPluginType == "Modeling")
            {
                //find prediction plugin, needs to show itself once modeling broadcasts itself with complete flag raised
                foreach (DotSpatial.Extensions.IExtension ex in App.Extensions)
                {
                    IPlugin plugin = (IPlugin)ex;
                    if (plugin.PluginType.ToString() == "Prediction")
                        //already visible, just update not show again
                        if (plugin.VisiblePlugin)
                            return;
                        else
                            //modeling is complete, show prediction
                            if (((IPlugin)sender).Complete)
                                plugin.Show();
                }
            }
        }
コード例 #11
0
ファイル: Serialization.cs プロジェクト: wrbrooks/VB3
 //raise event to pack each plugin for saving and add to PackedPluginStates dictionary
 private void ProjectSavedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e)
 {
     e.PackedPluginStates.Add(strPluginKey, PackState());
 }
コード例 #12
0
ファイル: Serialization.cs プロジェクト: wrbrooks/VB3
 //raise event to unpack each plugin, sending the plugin dictionary
 private void ProjectOpenedListener(object sender, VBCommon.PluginSupport.SerializationEventArgs e)
 {
     if (e.PackedPluginStates.ContainsKey(strPluginKey))
     {
         this.UnpackState(e.PackedPluginStates[strPluginKey]);
     }
     else
     {
         //Set this plugin to an empty state.
     }
 }