Exemplo n.º 1
0
        public BMDTimerControl(DynamicSheetWriter writer, int number) : base(writer, number)
        {
            InitializeComponent();
            this.headingLabel.Text      = "BMD " + number;
            this.headingLabel.AutoSize  = false;
            this.headingLabel.TextAlign = ContentAlignment.TopCenter;
            this.headingLabel.Dock      = DockStyle.Fill;
            this.writer.WriteLineArrWithoutLineBreak(new string[] {
                "BMD " + number + " start",
                "BMD " + number + " end",
                "BMD " + number + " duration",
                "BMD " + number + " help",
                "BMD " + number + " comments"
            });
            this.writer.FormatPretty();
            this.clearButton.Click += (s, e) => { this.textbox.Text = ""; };
            this.stopButton.Enabled = false;
            this.helpButton.Enabled = false;
            this.neverStarted       = true;
            this.helped             = false;

            // Set keyboard shortcuts
            string[] shortcuts = TimerControl.GetShortCutsForStartAndStop(number);
            if (shortcuts[0] != null && shortcuts[1] != null)
            {
                this.startButton.Text = this.startButton.Text + " (&" + shortcuts[0] + ")";
                this.stopButton.Text  = this.stopButton.Text + " (&" + shortcuts[1] + ")";
            }
        }
Exemplo n.º 2
0
        public static TimerControl GetTimerControl(TimerType timerType, DynamicSheetWriter writer, int number)
        {
            switch (timerType)
            {
            case TimerType.CHECKIN:
                return(new CheckInTimerControl(writer, number));

            case TimerType.ARRIVAL:
                return(new ArrivalTimerControl(writer));

            case TimerType.VOTING_BOOTH:
                return(new VotingBoothTimerControl(writer, number));

            case TimerType.BMD:
                return(new BMDTimerControl(writer, number));

            case TimerType.BALLOT_SCANNING:
                return(new BallotScanningTimerControl(writer, number));

            case TimerType.THROUGHPUT:
                return(new ThroughputTimerControl(writer, number));

            default:
                return(null);
            }
        }
Exemplo n.º 3
0
        private void PopulateArrivalTimer(Worksheet sheet)
        {
            DynamicSheetWriter  writer       = new DynamicSheetWriter(sheet, 0, 0);
            ArrivalTimerControl arrivalTimer = new ArrivalTimerControl(writer);

            this.leftPanel.Controls.Add(arrivalTimer);
            this.RegisterTimer(arrivalTimer);
        }
Exemplo n.º 4
0
 public ArrivalTimerControl(DynamicSheetWriter writer) : base(writer, 0)
 {
     InitializeComponent();
     writer.WriteLineArrWithoutLineBreak(new string[] {
         "Arrival time",
         "Arrival type",
         "Arrival comment"
     });
     writer.FormatPretty();
     this.neverStarted           = true;
     this.undoLastButton.Enabled = false;
     this.totalArrivals          = 0;
 }
Exemplo n.º 5
0
 private void PopulateTimersTablePanel(TimerControl.TimerType[] timerTypes, Worksheet sheet, int rowOffset = 0, int columnOffset = 0)
 {
     this.timersPanel.ColumnCount = timerTypes.Length;
     this.timersPanel.RowCount    = 1;
     this.timersPanel.ColumnStyles.Clear();
     for (int i = 0; i < timerTypes.Length; i++)
     {
         int columnCount            = i > 0 ? TimerControl.GetColumnCountForTimerType(timerTypes[i - 1]) : 0;
         DynamicSheetWriter writer  = new DynamicSheetWriter(sheet, rowOffset + 0, columnOffset + i * columnCount);
         TimerControl       control = TimerControl.GetTimerControl(timerTypes[i], writer, i + 1);
         this.timersPanel.Controls.Add(control, i, 0);
         if (timerTypes.Length <= 6)
         {
             this.timersPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f / timerTypes.Length));
         }
         this.RegisterTimer(control);
     }
 }
Exemplo n.º 6
0
 public TimerControl(DynamicSheetWriter writer, int number)
 {
     this.writer = writer;
     this.number = number;
 }