Handle MyStepRTB Dispose

Fixed a NullReference Bug
This commit is contained in:
Rich
2011-02-11 21:14:08 +00:00
parent 0ad442ae19
commit 2876ad911a
2 changed files with 13 additions and 2 deletions

View File

@@ -157,7 +157,11 @@ namespace Volian.Controls.Library
_MyItemInfo = args.MyItemInfo;
_MyEditItem = args.MyEditItem;
if (_MyEditItem != null)
{
_MyStepRTB = _MyEditItem.MyStepRTB;
if(_MyStepRTB != null)
_MyStepRTB.Disposed += new EventHandler(_MyStepRTB_Disposed);
}
else
_MyStepRTB = null;
}
@@ -169,6 +173,10 @@ namespace Volian.Controls.Library
}
if (ItemSelectedChanged != null) ItemSelectedChanged(sender, args);
}
void _MyStepRTB_Disposed(object sender, EventArgs e)
{
_MyStepRTB = null;
}
public event StepPanelModeChangeEvent ModeChange;
internal void OnModeChange(object sender, StepRTBModeChangeEventArgs args)
{