Beispiel #1
0
 internal void utility_SelectionChanged(IUtility sender, SelectionEventArgs ea)
 {
     if (sender != null)
     {
         UtilitiesMgr[sender.Id].SetIsSelected(ea.IsSelected, ea.Source, ea.Origin);
     }
 }
Beispiel #2
0
 protected virtual void OnSelectionChanged(SelectionEventArgs ea)
 {
     if (SelectionChanged != null)
         SelectionChanged(this, ea);
 }
Beispiel #3
0
 public void SelectionChanged_DummyHandlerWhichThrows(IPipe sender, SelectionEventArgs ea)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Beispiel #4
0
 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 ???.
     }
 }
Beispiel #5
0
 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);
             }
         }
     }
 }
Beispiel #6
0
 public void SelectionChanged_DummyHandler(IPipe sender, SelectionEventArgs ea)
 {
     SelectionChanged_TimesCalled++;
 }
Beispiel #7
0
 public void SelectionChanged_DummyHandler(IApp sender, SelectionEventArgs ea)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Beispiel #8
0
 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);
             }
         }
     }
 }
Beispiel #9
0
 internal void _View_SelectionChanged(IPipeView sender, SelectionEventArgs ea)
 {
     if (sender != null)
     {
         SelectionChangedFromView(ea.IsSelected, ea.Source, ea.Origin);
     }
 }
Beispiel #10
0
 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.");
 }
Beispiel #11
0
 internal void workSpace_SelectionChanged(IWorkSpace sender, SelectionEventArgs ea)
 {
     if (sender != null)
     {
      //TODO   WorkSpaceMgr[sender.Id].SetIsSelected(ea.IsSelected, ea.Source, ea.Origin);
     }
 }
Beispiel #12
0
        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));
        }
Beispiel #13
0
        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());
        }