Exemple #1
0
        //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();
            }
        }