Esempio n. 1
0
        private void LoadConfiguration()
        {
            Configuration configuration = SerializeConfiguration.ReaderXml();

            txtEmail.Text        = configuration.Email;
            txtPassword.Password = configuration.Password;
            txtPath.Text         = configuration.PathProgram;
        }
Esempio n. 2
0
 private void btnGravar_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtEmail.Text) && !string.IsNullOrEmpty(txtPassword.Password) && !string.IsNullOrEmpty(txtPath.Text))
         {
             Configuration configuration = new Configuration()
             {
                 Email = txtEmail.Text, Password = txtPassword.Password, PathProgram = txtPath.Text
             };
             if (SerializeConfiguration.CreateXml(configuration))
             {
                 MessageBox.Show("Configurãções salvas com sucesso");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
 private void Run()
 {
     try
     {
         if (SerializeConfiguration.ExistArchice())
         {
             StartProgram startProgram = new StartProgram();
             ThreadManager.ThreadManagerApp(20000);
             ScreenshotImage.ScreenShot(this);
             LoadConfiguration();
             SendEmail.Send();
         }
         else
         {
             MessageBox.Show(string.Format("Insira dados de configuração para poder usar o aplicativo." + "\n O arquivo no caminho ({0}) não foi localizado.", SerializeConfiguration.pathArchive));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }