示例#1
0
        public DigitalClock(ITimeSubject timemodel, Canvas canvas1)
        {
            this.canvas1 = canvas1;

            this.digithl = new Digit(XPOS + 0 * (XSIZE + 8 * STROKETHICKNESS), YPOS, XSIZE, YSIZE, STROKETHICKNESS);
            this.digithr = new Digit(XPOS + 1 * (XSIZE + 8 * STROKETHICKNESS), YPOS, XSIZE, YSIZE, STROKETHICKNESS);
            this.digitml = new Digit(5 + XPOS + 2 * (XSIZE + 8 * STROKETHICKNESS), YPOS, XSIZE, YSIZE, STROKETHICKNESS);
            this.digitmr = new Digit(5 + XPOS + 3 * (XSIZE + 8 * STROKETHICKNESS), YPOS, XSIZE, YSIZE, STROKETHICKNESS);
            this.digitsl = new Digit(10 + XPOS + 4 * (XSIZE + 8 * STROKETHICKNESS), YPOS, XSIZE, YSIZE, STROKETHICKNESS);
            this.digitsr = new Digit(10 + XPOS + 5 * (XSIZE + 8 * STROKETHICKNESS), YPOS, XSIZE, YSIZE, STROKETHICKNESS);

            this.timemodel = timemodel;
            timemodel.RegisterObserver(this);
        }
示例#2
0
        public DigitalClock(ITimeSubject timemodel, Canvas canvas1, Brush brush1, int xpos, int ypos, int xsize, int ysize, int strokethickness, bool blankleading, bool fourdigit)
        {
            this.canvas1 = canvas1;
            this.blankleading = blankleading;
            this.fourdigit = fourdigit;

            this.digithl = new Digit(xpos + 0 * (xsize + 8 * strokethickness), ypos, xsize, ysize, strokethickness, brush1);
            this.digithr = new Digit(xpos + 1 * (xsize + 8 * strokethickness), ypos, xsize, ysize, strokethickness, brush1);
            this.digitml = new Digit(8 + xpos + 2 * (xsize + 8 * strokethickness), ypos, xsize, ysize, strokethickness, brush1);
            this.digitmr = new Digit(8 + xpos + 3 * (xsize + 8 * strokethickness), ypos, xsize, ysize, strokethickness, brush1);
            this.digitsl = new Digit(10 + xpos + 4 * (xsize + 8 * strokethickness), ypos, xsize, ysize, strokethickness, brush1);
            this.digitsr = new Digit(10 + xpos + 5 * (xsize + 8 * strokethickness), ypos, xsize, ysize, strokethickness, brush1);

            this.timemodel = timemodel;
            timemodel.RegisterObserver(this);
        }