Пример #1
0
            private void InitiateWindowSelectionSequence()
            {
                // The state machine must be in idle state.
                if (this.currentState != State.None)
                {
                    throw new InvalidOperationException();
                }

                // Clear existing selection set.
                var             selectNothing   = new DynCmd.SelectModelCommand(Guid.Empty, ModifierKeys.None);
                DynamoViewModel dynamoViewModel = dynSettings.Controller.DynamoViewModel;

                dynamoViewModel.ExecuteCommand(selectNothing);

                // Update the selection box and make it visible
                // but with an initial dimension of zero.
                SelectionBoxUpdateArgs args = null;

                args = new SelectionBoxUpdateArgs(mouseDownPos.X, mouseDownPos.Y, 0, 0);
                args.SetVisibility(Visibility.Visible);

                this.owningWorkspace.RequestSelectionBoxUpdate(this, args);

                SetCurrentState(State.WindowSelection);

                // visualization pause
                owningWorkspace.OnDragSelectionStarted(this, EventArgs.Empty);
            }
Пример #2
0
        public void TestSelectModelCommand()
        {
            Guid         modelGuid = Guid.NewGuid();
            ModifierKeys modifiers = ((randomizer.Next(2) == 0) ?
                                      ModifierKeys.Control : ModifierKeys.Alt);

            var cmdOne = new DynCmd.SelectModelCommand(modelGuid, modifiers);
            var cmdTwo = DuplicateAndCompare(cmdOne);

            Assert.AreEqual(cmdOne.ModelGuid, cmdTwo.ModelGuid);
            Assert.AreEqual(cmdOne.Modifiers, cmdTwo.Modifiers);
        }
Пример #3
0
            private void InitiateWindowSelectionSequence()
            {
                // visualization pause
                owningWorkspace.OnDragSelectionStarted(this, EventArgs.Empty);

                // The state machine must be in idle state.
                if (this.currentState != State.None)
                    throw new InvalidOperationException();

                // Clear existing selection set.
                var selectNothing = new DynCmd.SelectModelCommand(Guid.Empty, ModifierKeys.None);
                DynamoViewModel dynamoViewModel = dynSettings.Controller.DynamoViewModel;
                dynamoViewModel.ExecuteCommand(selectNothing);

                // Update the selection box and make it visible 
                // but with an initial dimension of zero.
                SelectionBoxUpdateArgs args = null;
                args = new SelectionBoxUpdateArgs(mouseDownPos.X, mouseDownPos.Y, 0, 0);
                args.SetVisibility(Visibility.Visible);

                this.owningWorkspace.RequestSelectionBoxUpdate(this, args);

                SetCurrentState(State.WindowSelection);
            }