Пример #1
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            RelogioXML relogioXML = new RelogioXML();

            BolsasModel bolsa = (BolsasModel)cmbBolsas.SelectedItem;
            GMTModel    gmt   = (GMTModel)cmbGMTs.SelectedItem;

            relogioXML.Abertura     = txtAbertura.Text;
            relogioXML.Bandeira     = bolsa.Bandeira;
            relogioXML.Fechamento   = txtFechamento.Text;
            relogioXML.FormCompacto = false;
            relogioXML.GMT          = gmt.Chave;
            relogioXML.Height       = formRelogio.ALTURA_NORMAL;
            relogioXML.Width        = formRelogio.LAGURA_NORMAL;
            relogioXML.HorarioVerao = chkHorarioVerao.Checked;
            relogioXML.NomeBolsa    = bolsa.NomeBolsa;
            relogioXML.Sigla        = bolsa.Sigla;

            ConfigHelper.SalvarRelogio(relogioXML);

            formRelogio form = new formRelogio();

            form.relogioXML = relogioXML;
            form.Show();

            this.Close();
        }
Пример #2
0
        /// <summary>
        /// Displays the icon in the system tray.
        /// </summary>
        public void Display()
        {
            // Put the icon in the system tray and allow it react to mouse clicks.
            ni.MouseClick += new MouseEventHandler(ni_MouseClick);
            ni.Icon        = Resources.clock1;
            ni.Text        = "GMT+0 : " + DateTime.Now.ToUniversalTime().ToString("HH:mm:ss");
            ni.Visible     = true;


#if !DEBUG
            ni.BalloonTipIcon  = ToolTipIcon.Info;
            ni.BalloonTipTitle = ConfigHelper.RetornaVersao();
            ni.BalloonTipText  = "Aplicativo de relógios iniciado";
            ni.ShowBalloonTip(1500);
#endif

            // Attach a context menu.
            ni.ContextMenuStrip = new ContextMenus().Create();

            ConfigXML configXML = ConfigHelper.CarregarConfig();

            foreach (RelogioXML relogio in configXML.Relogios)
            {
                formRelogio form = new formRelogio();
                form.relogioXML = relogio;
                form.Show();
            }
        }