Esempio n. 1
0
        public void BrushTest1()
        {
            InkCanvas    MyCanvas = new InkCanvas();
            GlyphChanged glyph    = new GlyphChanged(MyCanvas);

            //Изначальная кисть должна быть Ink и Ellipse
            Assert.AreEqual(MyCanvas.EditingMode, InkCanvasEditingMode.Ink);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTip, StylusTip.Ellipse);

            // При выборе различных кисте (от 0й до 4й) меняются значения СтилусТип и СтилусТипТрансформейшн
            glyph.BrushesSelect(0);
            Assert.AreEqual(MyCanvas.EditingMode, InkCanvasEditingMode.Ink);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTip, StylusTip.Ellipse);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTipTransform, new Matrix(1, 0, 0, 1, 0, 0));

            glyph.BrushesSelect(1);
            Assert.AreEqual(MyCanvas.EditingMode, InkCanvasEditingMode.Ink);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTip, StylusTip.Rectangle);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTipTransform, new Matrix(1, 0, 0, 1, 0, 0));

            glyph.BrushesSelect(2);
            Assert.AreEqual(MyCanvas.EditingMode, InkCanvasEditingMode.Ink);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTip, StylusTip.Rectangle);
            Assert.AreEqual(MyCanvas.DefaultDrawingAttributes.StylusTipTransform, new Matrix(1, 2, 3, 3, 0, 0));

            glyph.BrushesSelect(3);
            Assert.AreEqual(MyCanvas.EditingMode, InkCanvasEditingMode.Select);

            glyph.BrushesSelect(4);
            Assert.AreEqual(MyCanvas.EditingMode, InkCanvasEditingMode.None);
        }
Esempio n. 2
0
 public void ChangeBrush(int value)
 {
     glyph.BrushesSelect(value);
 }