Exemplo n.º 1
0
        public void EditLineCommand()
        {
            _testInvoker.Start();
            Point Location1 = new Point(100, 102);
            Point Location2 = new Point(100, 110);

            AddCommand command3 = new AddCommand("Generalization", Location1, Location2, testDrawing);

            _testInvoker.EnqueueCommandForExecution(command3);
            System.Threading.Thread.Sleep(1000);

            int   newLineThickness = 10;
            Color newLineColor     = Color.Firebrick;
            Color newSymbolColor   = Color.DeepSkyBlue;
            int   newSymbolSize    = 3;

            EditLineCommand editLine = new EditLineCommand(testDrawing._RelationShipLines[0], newLineThickness, newLineColor, newSymbolColor, newSymbolSize, testDrawing);

            _testInvoker.EnqueueCommandForExecution(editLine);
            System.Threading.Thread.Sleep(1000);

            Assert.AreEqual(newLineThickness, testDrawing._RelationShipLines[0].LineThickness);
            Assert.AreEqual(newLineColor, testDrawing._RelationShipLines[0].LineColor);
            Assert.AreEqual(newSymbolColor, testDrawing._RelationShipLines[0].SymbolFillColor);
            Assert.AreEqual(newSymbolSize, testDrawing._RelationShipLines[0].SymbolSizeMultiplier);
        }
Exemplo n.º 2
0
        private void AcceptButton_Click(object sender, EventArgs e)
        {
            int newThickness = Convert.ToInt32(LineThicknessTextBox.Text);

            SymbolSizeMulitplier = Convert.ToInt32(SymbolSizeTextBox.Text);
            EditLineCommand command = new EditLineCommand(EditedLine, newThickness, NewLineColor, NewSymbolColor, SymbolSizeMulitplier, TargetDrawing);

            _invoker.EnqueueCommandForExecution(command);
            this.Hide();
        }