예제 #1
0
 public bool TryStartStroke(Point point, out SelectionBrush brush, Type type, bool clearSelection = true)
 {
     if (CurrentBrush != null || !typeof(SelectionBrush).IsAssignableFrom(type))
     {
         brush = null;
         return(false);
     }
     brush = DoStartStroke(point, type, clearSelection);
     return(true);
 }
예제 #2
0
        private SelectionBrush DoStartStroke(Point point, Type type, bool clearSelection)
        {
            if (clearSelection)
            {
                context.Clear();
            }
            var brush = Activator.CreateInstance(type) as SelectionBrush;

            brush.Context = context;
            brush.Manager = this;
            CurrentBrush  = brush;
            brush.StartStroke(point);
            return(brush);
        }