Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 private void SetClocks(object sender, EventArgs e)
 {
     if (Settings.IsClockFace)
     {
         clock = new ClockWithArrows(Settings.ObjectState);
     }
     else
     {
         clock = Settings.ObjectState;
     }
 }
Esempio n. 5
0
 public FormSettings(IClockBase clock)
 {
     InitializeComponent();
     this.clock           = (Clock)clock;
     dateTimePicker.Value = this.clock.Time;
 }