Beispiel #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Create the startup window
            SIMAIL.Views.Connexion FenStartup = new SIMAIL.Views.Connexion();
            FenStartup.currentCompteMessagerie = cm;

            // Paramètres comptes serveur
            string appDirectory = new KnownFolder(KnownFolderType.Documents).Path + "\\" + "SIMAIL";

            if (Directory.Exists(appDirectory) == false)
            {
                try
                {
                    Directory.CreateDirectory(appDirectory);
                }
                catch (Exception e2)
                {
                    MessageBox.Show(e2.Message);
                }
            }
            App.Current.Resources.Add("pathDefaultCompteServ", appDirectory);

            //paramètre de l'application
            string helpHttpAddress = "https://github.com/lynch251/SIMAIL";

            App.Current.Resources.Add("helpHttpAddress", helpHttpAddress);

            // Do stuff here, e.g. to the window
            FenStartup.Show();
            // Show the window
        }
Beispiel #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (currentCompteMessagerie.Equals(null))
            {
                MessageBox.Show("Connexion perdue !");
                Connexion fenConnexion = new Connexion();
                this.Close();
                Application.Current.MainWindow.Close();
                Application.Current.MainWindow = fenConnexion;
                fenConnexion.Show();
            }
            loadComptesServeur();
            loadCompteUtilisateurInfo();

            // Champs obligatoires
            _ChampsObligatoiresFournisseur = new Collection <TextBox>();
            _ChampsObligatoiresFournisseur.Add(this.I_CptMessagerie_Fournisseur);
            _ChampsObligatoiresFournisseur.Add(this.I_CptMessagerie_AdresseIMAP);
            _ChampsObligatoiresFournisseur.Add(this.I_CptMessagerie_PortIMAP);
            _ChampsObligatoiresFournisseur.Add(this.I_CptMessagerie_AdresseSMTP);
            _ChampsObligatoiresFournisseur.Add(this.I_CptMessagerie_PortSMTP);

            // Méthodes de connexion
            List <MethConnexion> methConnexionList = new List <MethConnexion>();

            I_CptMessagerie_ModeCnx.ItemsSource = methConnexionList;
            methConnexionList.Add(MethConnexion.Identifiants);
            //methConnexionList.Add(MethConnexion.OAuth2);
            //methConnexionList.Add(MethConnexion.OpenID);
        }
Beispiel #3
0
        private async void OnLoad(object sender, RoutedEventArgs e)
        {
            if (currentCompteMessagerie != null & currentCompteMessagerie.isAuthenticated())
            {
                NbMailToLoad = 25;
                hideMailControls();
                await openInbox();

                //lancement du rafraîchissement régulier
                currentCompteMessagerie.timerInboxReload = 1; // une minute -> à paramétrer
                timerInboxReload          = new System.Windows.Threading.DispatcherTimer();
                timerInboxReload.Interval = TimeSpan.FromMinutes(currentCompteMessagerie.timerInboxReload);
                timerInboxReload.Tick    += timer_Tick;
                timerInboxReload.Start();
            }
            else
            {
                MessageBox.Show("Connexion perdue !");
                Connexion fenConnexion = new Connexion();
                fenConnexion.Show();
                closeInbox();
            }
        }