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); }
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); }