[Mmclibrary-svn] SF.net SVN: mmclibrary:[11] MMCLib2/Core/SnapinBase.cs
Brought to you by:
imjimmurphy,
kachalkov
From: <tig...@us...> - 2009-07-15 08:44:45
|
Revision: 11 http://mmclibrary.svn.sourceforge.net/mmclibrary/?rev=11&view=rev Author: tigerharry Date: 2009-07-15 08:44:24 +0000 (Wed, 15 Jul 2009) Log Message: ----------- added event BeforeSnapinSaved Modified Paths: -------------- MMCLib2/Core/SnapinBase.cs Modified: MMCLib2/Core/SnapinBase.cs =================================================================== --- MMCLib2/Core/SnapinBase.cs 2008-06-09 09:53:49 UTC (rev 10) +++ MMCLib2/Core/SnapinBase.cs 2009-07-15 08:44:24 UTC (rev 11) @@ -236,7 +236,15 @@ #endregion + #region Events /// <summary> + /// Event triggered before snapin is saved by MMC. + /// With this event there is no need to override SnapinState class. + /// </summary> + public event EventHandler BeforeSnapinSaved; + #endregion Events + + /// <summary> /// Add the node to the currently active nodes in the snapin. /// </summary> /// <param name="bn">The node to add</param> @@ -1053,7 +1061,19 @@ } } + /// <summary> + /// Invoke method for BeforeSnapinSaved event. + /// <see cref="this.BeforeSnapinSaved"/> + /// </summary> + /// <param name="e"></param> + protected virtual void OnBeforeSnapinSaved(EventArgs e) + { + if (BeforeSnapinSaved != null) + BeforeSnapinSaved(this, e); + } + + /// <summary> /// Delegate back to the snapin-state for serialization. /// </summary> /// <param name="pStm"></param> @@ -1062,6 +1082,7 @@ { try { + OnBeforeSnapinSaved(new EventArgs()); System.Diagnostics.Debug.WriteLine("Save"); ComStream cs = new ComStream(pStm); this.SnapinState.WriteState(cs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |