public void BeginEditing() { if (!this.host.PropertyEditor.CaptureMouse()) { return; } this.host.PropertyEditor.LostMouseCapture += new MouseEventHandler(this.Owner_LostMouseCapture); this.host.PropertyEditor.MouseDown += new MouseButtonEventHandler(this.Owner_MouseDown); this.state = new PickWhipEngine.PickState(this.host); InputManager.Current.PostNotifyInput += new NotifyInputEventHandler(this.Current_PostNotifyInput); if (this.state.View != null && this.state.View.ViewModel != null) { this.state.View.ViewModel.Closing += new EventHandler(this.ViewModel_Closing); } this.state.OnMouseMovement(); }
public void FinishEditing() { if (this.state != null) { if (this.state.View != null && this.state.View.ViewModel != null) { this.state.View.ViewModel.Closing -= new EventHandler(this.ViewModel_Closing); } this.state.ClearState(); this.state = (PickWhipEngine.PickState)null; } InputManager.Current.PostNotifyInput -= new NotifyInputEventHandler(this.Current_PostNotifyInput); this.host.PropertyEditor.ReleaseMouseCapture(); this.host.PropertyEditor.LostMouseCapture -= new MouseEventHandler(this.Owner_LostMouseCapture); this.host.PropertyEditor.MouseDown -= new MouseButtonEventHandler(this.Owner_MouseDown); }