//Tell the plugins to pack their states into the dictionary for saving public void RaiseSaveRequest(IDictionary<string, IDictionary<string, object>> dictPackedStates) { if (ProjectSaved != null) //Has some method been told to handle this event? { SerializationEventArgs e = new SerializationEventArgs(dictPackedStates); ProjectSaved(this, e); } }
//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. } }
//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()); }
private void ProjectSavedListener(object sender, SerializationEventArgs e) { e.PackedPluginStates.Add(strPanelKey, cLocation.PackState()); }
private void ProjectOpenedListener(object sender, SerializationEventArgs e) { if (e.PackedPluginStates.ContainsKey(strPanelKey)) { //Unpack the state of this plugin. cLocation.UnpackState(e.PackedPluginStates[strPanelKey]); } else { //Set this plugin to an empty state. } }