示例#1
0
 void updateSettings()
 {
     NFe.Components.XMLIniFile xml = new NFe.Components.XMLIniFile(NFe.Components.Propriedade.NomeArqXMLParams);
     xml.WriteValue(this.Name, "Theme", this.metroStyleManager1.Theme);
     xml.WriteValue(this.Name, "Style", this.metroStyleManager1.Style);
     xml.Save();
 }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //
            //SERVICO: danasa 7/2011
            //servico está instalado e rodando?
            this.servicoInstaladoErodando = Propriedade.ServicoRodando;

            this.tbSeparator1.Visible           =
                this.tbRestartServico.Visible   =
                    this.tbPararServico.Visible = this.servicoInstaladoErodando;

            this.updateControleDoServico();

            ///
            /// danasa 9-2009
            ///
            this.MinimumSize = new Size(800, 600);
            //Trazer minimizado e no systray
            this.notifyIcon1.Visible = true;
            this.WindowState         = FormWindowState.Minimized;
            this.Visible             = false;
            this.ShowInTaskbar       = false;
            this.notifyIcon1.ShowBalloonTip(6000);

            //Propriedade.TipoAplicativo = TipoAplicativo.Nfe;
            //ConfiguracaoApp.AtualizaWSDL = !System.IO.File.Exists(Propriedade.NomeArqXMLWebService); //danasa: 12/2013
            ConfiguracaoApp.StartVersoes();

            if (!this.servicoInstaladoErodando)     //danasa 12/8/2011
            //Definir eventos de controles de execução das thread´s de serviços do UniNFe. Wandrey 26/07/2011
            {
                new ThreadControlEvents();  //danasa 12/8/2011
            }
            //Executar os serviços do UniNFe em novas threads
            //Tem que ser carregado depois que o formulário da MainForm estiver totalmente carregado para evitar Erros. Wandrey 19/10/2010
            this.ExecutaServicos();


            NFe.Components.XMLIniFile xml = new NFe.Components.XMLIniFile(NFe.Components.Propriedade.NomeArqXMLParams);
            this.metroStyleManager1.Theme = xml.ReadValue(this.Name, "Theme", this.metroStyleManager1.Theme);
            this.metroStyleManager1.Style = xml.ReadValue(this.Name, "Style", this.metroStyleManager1.Style);

            switch (NFe.Components.Propriedade.TipoAplicativo)
            {
            case NFe.Components.TipoAplicativo.Nfe:
                this.notifyIcon1.Icon =
                    this.Icon         = Properties.Resources.uninfe1;
                break;

            case NFe.Components.TipoAplicativo.Nfse:
                this.notifyIcon1.Icon =
                    this.Icon         = Properties.Resources.uninfse;
                break;
            }
            this.notifyIcon1.BalloonTipText  = string.Format(this.notifyIcon1.BalloonTipText, NFe.Components.Propriedade.NomeAplicacao);
            this.notifyIcon1.BalloonTipTitle =
                this.notifyIcon1.Text        = NFe.Components.Propriedade.NomeAplicacao + " - " + NFe.Components.Propriedade.DescricaoAplicacao;

            EnableControlsCM();

            this.cmConsultaCadastro.Visible =
                this.cmDANFE.Visible        = NFe.Components.Propriedade.TipoAplicativo == TipoAplicativo.Nfe;

            this.cmAbrir.Text  = "Abrir " + NFe.Components.Propriedade.NomeAplicacao;
            this.cmFechar.Text = "Fechar " + NFe.Components.Propriedade.NomeAplicacao;
            this.cmSobre.Text  = "Sobre o " + NFe.Components.Propriedade.NomeAplicacao;
            this.cmManual.Text = "Manual do " + NFe.Components.Propriedade.NomeAplicacao;

            _menu = new menu();
            this.Controls.Add(_menu);
            _menu.Dock = DockStyle.Fill;


            /*
             * foreach (var item in MetroStyleManager.Styles.Themes)
             * {
             *  Console.WriteLine(item.Key.ToString());
             * }*/
        }