public override void RenderAdorner(System.Windows.Forms.Control control, AdornerType t) { if (t == AdornerType.Error) { control.BackColor = Color.Red; } }
public override void RenderAdorner(Control control, AdornerType t) { if (t == AdornerType.Error) { control.BackColor = Color.Red; } }
public static Pen GetThinPen(AdornerType adornerType) { switch (adornerType) { case AdornerType.Default: return(FeedbackHelper.DefaultThinPen); case AdornerType.Inactive: return(FeedbackHelper.InactiveThinPen); case AdornerType.MultipleElement: return(FeedbackHelper.MultipleElementThinPen); case AdornerType.ClipPath: case AdornerType.ClipPathSegment: return(FeedbackHelper.ClipPathThinPen); case AdornerType.MotionPath: return(FeedbackHelper.MotionPathThinPen); case AdornerType.MotionPathSegment: return(FeedbackHelper.MotionPathSegmentThinPen); default: return(FeedbackHelper.DefaultThinPen); } }
private Rectangle GetAdorner(Point position) { double left = Canvas.GetLeft(MainRectangle); double top = Canvas.GetTop(MainRectangle); double right = left + MainRectangle.Width; double bottom = top + MainRectangle.Height; if (position.X < left && position.Y <= bottom - (MainRectangle.Height / 2.0)) { _selectedAdornerType = AdornerType.TopLeft; return(adorners[0]); } else if (position.X > right && position.Y <= bottom - (MainRectangle.Height / 2.0)) { _selectedAdornerType = AdornerType.TopRight; return(adorners[1]); } else if (position.X < left && position.Y > bottom - (MainRectangle.Height / 2.0)) { _selectedAdornerType = AdornerType.BottomLeft; return(adorners[2]); } else if (position.X > right && position.Y > bottom - (MainRectangle.Height / 2.0)) { _selectedAdornerType = AdornerType.BottomRight; return(adorners[3]); } else { _selectedAdornerType = AdornerType.None; return(null); } }
public static Brush GetActiveBrush(AdornerType adornerType) { if (adornerType == AdornerType.ClipPath) { return(FeedbackHelper.ClipPathBrush); } return(FeedbackHelper.DefaultAdornerBrush); }
public static IScriptCommand AssignAdornerLayer(AdornerType assignAdornerType, string destinationVariable = "{AdornerLayer}", bool skipIfExists = false, IScriptCommand foundCommand = null, IScriptCommand notFoundCommand = null) { return(new AssignAdornerLayer() { AssignAdornerType = assignAdornerType, DestinationKey = destinationVariable, SkipIfExists = skipIfExists, NextCommand = (ScriptCommandBase)foundCommand, FailCommand = (ScriptCommandBase)notFoundCommand }); }
public static Pen GetMediumPen(AdornerType adornerType) { switch (adornerType) { case AdornerType.Default: return(FeedbackHelper.DefaultMediumPen); case AdornerType.MultipleElement: return(FeedbackHelper.MultipleElementMediumPen); default: return(FeedbackHelper.DefaultMediumPen); } }
public static Pen GetThickPen(AdornerType adornerType) { switch (adornerType) { case AdornerType.ClipPath: case AdornerType.ClipPathSegment: return(FeedbackHelper.ClipPathThickPen); case AdornerType.MotionPath: return(FeedbackHelper.MotionPathThickPen); case AdornerType.MotionPathSegment: return(FeedbackHelper.MotionPathSegmentThickPen); default: return(FeedbackHelper.DefaultThickPen); } }
public bool CheckAdornerHit(Point position) { for (int i = 0; i < 4; i++) { double left = Canvas.GetLeft(adorners[i]); double top = Canvas.GetTop(adorners[i]); double right = left + adorners[i].Width; double bottom = top + adorners[i].Height; if (position.X >= left && position.X <= right && position.Y >= top && position.Y <= bottom) { activeAdorner = adorners[i]; switch (i) { case 0: _selectedAdornerType = AdornerType.TopLeft; break; case 1: _selectedAdornerType = AdornerType.TopRight; break; case 2: _selectedAdornerType = AdornerType.BottomLeft; break; case 3: _selectedAdornerType = AdornerType.BottomRight; break; } return(true); } } return(false); }
/// <summary> /// /// </summary> /// <param name="control"></param> /// <param name="t"></param> public abstract void RenderAdorner(Control control, AdornerType t);
public static void SetAdornerType(DependencyObject d, AdornerType value) { d.SetValue(AdornerTypeProperty, value); }
public static void SetAdornerType(DependencyObject d, AdornerType value) { d.SetValue(AdornerTypeProperty, value); }