//METHODS public override void LoadDefaultValues() { _n_length = 0.2; _thickness = 0.03; _n_color = "#FFA9A9A9"; _p_length = 0.9; _endtype = ClockHandType.Normal; _p_color = "#FFFFFFFF"; _circlesize = 0.08; _circlecolor = "#FFA9A9A9"; _circlebehindthearrow = false; _value = 0; _angle = 0; _manualangle = false; ValidateWithSource(); base.LoadDefaultValues(); }
public override void CloneCreator(Layer original, string name) { base.CloneCreator(original, name); ClockHand_Item o = (ClockHand_Item)original; _n_length = o._n_length; _thickness = o._thickness; _n_color = o._n_color; _p_length = o._p_length; _endtype = o._endtype; _p_color = o._p_color; _circlesize = o._circlesize; _circlecolor = o._circlecolor; _circlebehindthearrow = o._circlebehindthearrow; _value = o._value; _angle = o._angle; _manualangle = o._manualangle; }
private int GetClockHandTypeSpecificAngle(ClockHandType type) { DateTime currentTime = DateTime.Now; switch (type) { case ClockHandType.HourHand: return(GetAngle(currentTime.Hour, 30, currentTime.Minute)); case ClockHandType.MinuteHand: return(GetAngle(currentTime.Minute, 6)); case ClockHandType.SecondHand: return(GetAngle(currentTime.Second, 6)); default: return(0); } }
private void DrawClockHand(Graphics graph, List <Point> points, Color color, Point center, ClockHandType type) { if (points.Count >= 3) { int angle = GetClockHandTypeSpecificAngle(type); List <Point> polygonTransformed = RotatePolygon(points, center, angle); graph.FillPolygon(new SolidBrush(color), polygonTransformed.ToArray()); } }