internal void utility_SelectionChanged(IUtility sender, SelectionEventArgs ea) { if (sender != null) { UtilitiesMgr[sender.Id].SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); } }
protected virtual void OnSelectionChanged(SelectionEventArgs ea) { if (SelectionChanged != null) SelectionChanged(this, ea); }
public void SelectionChanged_DummyHandlerWhichThrows(IPipe sender, SelectionEventArgs ea) { throw new Exception("The method or operation is not implemented."); }
internal void element_SelectionChanged(IElement sender, SelectionEventArgs ea) { if (sender!=null) { ElementsMgr[sender.Id].SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); // TODO WHAT ABOUT WHEN MULTIPLE Elements ARE UNSELECTED ???. } }
internal void _View_SelectionChanged(IUtilityView sender, SelectionEventArgs ea) { if (sender != null) { // the change originated at the UI level and has already been applied at the UI level. if (_Comment.IsSelected != ea.IsSelected) { // propagate the selection change to the model if the Source is a UI source: Mouse, Keyboard, UserInput if (ea.Source == SelectionSource.Mouse) { _Comment.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Comment); } else if (ea.Source == SelectionSource.KeyBoard) { _Comment.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Comment); } else if (ea.Source == SelectionSource.UserInput) { _Comment.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Comment); } } } }
public void SelectionChanged_DummyHandler(IPipe sender, SelectionEventArgs ea) { SelectionChanged_TimesCalled++; }
public void SelectionChanged_DummyHandler(IApp sender, SelectionEventArgs ea) { //throw new Exception("The method or operation is not implemented."); }
internal void _Comment_SelectionChanged(IUtility sender, SelectionEventArgs ea) { // selection change can be initiated from code since the sender is the IElement, ie model if (sender != null) { // the change originated at the model level and has already been applied to the model if (_View.IsSelected != ea.IsSelected) { // propagate the selection change to the View if the Source is a Model source: Code if (ea.Source == SelectionSource.Code) { _View.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Comment); } } } }
internal void _View_SelectionChanged(IPipeView sender, SelectionEventArgs ea) { if (sender != null) { SelectionChangedFromView(ea.IsSelected, ea.Source, ea.Origin); } }
internal void _Pipe_SelectionChanged(IPipe sender, SelectionEventArgs ea) { // not doing anything with this right now throw new NotImplementedException("The method or operation is not implemented."); }
internal void workSpace_SelectionChanged(IWorkSpace sender, SelectionEventArgs ea) { if (sender != null) { //TODO WorkSpaceMgr[sender.Id].SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); } }
public void element_SelectionChangedEventHandlerSetsIsSelectedOnEachElementSelected() { var wkSpce = new WorkSpace(); var mockElMgr = new Mock<IElements>(); var mockEl = new Mock<IElement>(); var ea = new SelectionEventArgs(true, SelectionSource.Code); mockElMgr.Setup(m => m[new Guid()]).Returns(mockEl.Object); mockEl.Setup(m => m.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin)); wkSpce.ElementsMgr = mockElMgr.Object; wkSpce.element_SelectionChanged(mockEl.Object, ea); mockElMgr.Verify(m => m[new Guid()], Times.Exactly(1)); }
public void element_SelectionChangedEventHandlerDoesNothingIfSender_Is_Null() { var wkSpce = new WorkSpace(); var mockElMgr = new Mock<IElements>(); var mockEl = new Mock<IElement>(); var ea = new SelectionEventArgs(true, SelectionSource.Code); mockElMgr.Setup(m => m[new Guid()]).Returns(mockEl.Object); wkSpce.ElementsMgr = mockElMgr.Object; wkSpce.element_SelectionChanged(null, ea); mockElMgr.Verify(m => m[new Guid()], Times.Never()); }