コード例 #1
0
        void FormatOnClick(object sender, RoutedEventArgs e)
        {
            StylusToolDialog dlg = new StylusToolDialog()
            {
                Owner = this,
                Title = "Format selection"
            };

            // stroke for the first selected stroke
            StrokeCollection strokes = inkcanv.GetSelectedStrokes();

            if (strokes.Count > 0)
            {
                dlg.DrawingAttributes = strokes[0].DrawingAttributes;
            }
            else
            {
                dlg.DrawingAttributes = inkcanv.DefaultDrawingAttributes;
            }

            if ((bool)dlg.ShowDialog().GetValueOrDefault())
            {
                foreach (Stroke strk in strokes)
                {
                    strk.DrawingAttributes = dlg.DrawingAttributes;
                }
            }
        }
コード例 #2
0
        // Format Selection item: invoke StylusToolDialog.
        void FormatOnClick(object sender, RoutedEventArgs args)
        {
            StylusToolDialog dlg = new StylusToolDialog();

            dlg.Owner = this;
            dlg.Title = "Format Selection";

            // Try getting the DrawingAttributes of the first selected stroke.
            StrokeCollection strokes = inkcanv.GetSelectedStrokes();

            if (strokes.Count > 0)
            {
                dlg.DrawingAttributes = strokes[0].DrawingAttributes;
            }
            else
            {
                dlg.DrawingAttributes = inkcanv.DefaultDrawingAttributes;
            }

            if ((bool)dlg.ShowDialog().GetValueOrDefault())
            {
                // Set the DrawingAttributes of all the selected strokes.
                foreach (Stroke strk in strokes)
                {
                    strk.DrawingAttributes = dlg.DrawingAttributes;
                }
            }
        }
コード例 #3
0
        // StylusToolDialog�� ���� DrawingAttributes property�� ����Ѵ�.
        void StylusToolOnClick(object sender, RoutedEventArgs args)
        {
            StylusToolDialog dlg = new StylusToolDialog();
            dlg.Owner = this;
            dlg.DrawingAttributes = inkcanv.DefaultDrawingAttributes;

            if ((bool)dlg.ShowDialog().GetValueOrDefault())
            {
                inkcanv.DefaultDrawingAttributes = dlg.DrawingAttributes;
            }
        }
コード例 #4
0
        // Display StylusToolDialog and use DrawingAttributes property.
        void StylusToolOnClick(object sender, RoutedEventArgs args)
        {
            StylusToolDialog dlg = new StylusToolDialog();

            dlg.Owner             = this;
            dlg.DrawingAttributes = inkcanv.DefaultDrawingAttributes;

            if ((bool)dlg.ShowDialog().GetValueOrDefault())
            {
                inkcanv.DefaultDrawingAttributes = dlg.DrawingAttributes;
            }
        }
コード例 #5
0
        // Format Selection item: invoke StylusToolDialog.
        void FormatOnClick(object sender, RoutedEventArgs args)
        {
            StylusToolDialog dlg = new StylusToolDialog();
            dlg.Owner = this;
            dlg.Title = "Format Selection";

            // Try getting the DrawingAttributes of the first selected stroke.
            StrokeCollection strokes = inkcanv.GetSelectedStrokes();

            if (strokes.Count > 0)
                dlg.DrawingAttributes = strokes[0].DrawingAttributes;
            else
                dlg.DrawingAttributes = inkcanv.DefaultDrawingAttributes;

            if ((bool)dlg.ShowDialog().GetValueOrDefault())
            {
                // Set the DrawingAttributes of all the selected strokes.
                foreach (Stroke strk in strokes)
                    strk.DrawingAttributes = dlg.DrawingAttributes;
            }
        }