Esempio n. 1
0
        private void frmTimer_Load(object sender, EventArgs e)
        {
            curH = Convert.ToInt32(cConfig.GetParameter("H", "0"));
            curM = Convert.ToInt32(cConfig.GetParameter("M", "0"));
            curS = Convert.ToInt32(cConfig.GetParameter("S", "0"));

            SetTime(curH, curM, curS, true);

            lblPause.Enabled = false;

            //создаем контекстное меню с заранее заданными временными интервалами
            int i = 0;

            cmnStandTime.Items.Clear();
            foreach (int t in StandTimeMin)
            {
                ToolStripMenuItem cmnStandTimeMenuItem = new ToolStripMenuItem();
                cmnStandTimeMenuItem.Name   = "cmnStandTimeMenuItem" + i.ToString();
                cmnStandTimeMenuItem.Text   = "Таймер на " + t.ToString() + " минут(ы)";
                cmnStandTimeMenuItem.Click += new EventHandler(cmnStandTimeMenuItem_Click);
                cmnStandTime.Items.Add(cmnStandTimeMenuItem);
                i++;
            }

            //выгрузка шрифта из ресурсов во временный файл
            string fontfile = CommonFunctions.TempFileWrite(Properties.Resources.lcdnova);

            if (fontfile != string.Empty)
            {
                myFonts.AddFontFile(fontfile);
                lblTimer.Font = new Font(myFonts.Families[0], 40);
                txtS.Font     = new Font(myFonts.Families[0], 15);
                txtM.Font     = new Font(myFonts.Families[0], 15);
                txtH.Font     = new Font(myFonts.Families[0], 15);
            }
        }