public static void Set(bool isClockFace, Point location, Size size, Form form, Func <Clock, Clock> func) { IsClockFace = isClockFace; Clock basestate = new Clock(location, size, form); objectstate = func(basestate); }
private void FormMain_Load(object sender, EventArgs e) { clock = new Clock(new Point(0, 0), Size, this); ((Clock)clock).TimeChanged.Subscribe(new ClockMinuteNotifier()); ((Clock)clock).TimeChanged.Subscribe(new ClockHourNotifier()); clock.Show(); timer.Start(); }
public ClockWithArrows(IClockBase clockbase) { clock = (Clock)clockbase; center = new Point(clock.DrawingSize.Width / 2, clock.DrawingSize.Height / 2); R = (clock.DrawingSize.Width / 2 < clock.DrawingSize.Height / 2 ? clock.DrawingSize.Width / 2 : clock.DrawingSize.Height / 2) - 50; bm = new Bitmap(clock.DrawingSize.Width, clock.DrawingSize.Height); _g = Graphics.FromImage(bm); clock.ParentForm.Resize += new EventHandler(OnResize); }
private void SetClocks(object sender, EventArgs e) { if (Settings.IsClockFace) { clock = new ClockWithArrows(Settings.ObjectState); } else { clock = Settings.ObjectState; } }
public FormSettings(IClockBase clock) { InitializeComponent(); this.clock = (Clock)clock; dateTimePicker.Value = this.clock.Time; }