예제 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Initialisation de l'email
            if (email == null)
            {
                email = new Classes.Email.Email();
            }
            if (currentCompteMessagerie != null)
            {
                if (currentCompteMessagerie.isAuthenticated())
                {
                    // Chargement des paramètres utilisateur
                    email.CompteMessagerie = currentCompteMessagerie;
                    email.From             = currentCompteMessagerie.Login;
                }
                else
                {
                    this.Close();
                }
            }

            if (this.action == Action.Reponse)
            {
                // Préchargement d'un mail
                I_A.Text     = email.ToToString();
                I_Cc.Text    = email.CCToString();
                I_Objet.Text = email.Object;
                I_Body.AppendText(email.Body.TextReponse);
            }
            if (this.action == Action.Transfert)
            {
                I_Objet.Text = email.Object;
                I_Body.AppendText(email.Body.TextReponse);
            }
            // Préchargement du mail utilisateur
            I_De.Text = email.From;
        }
예제 #2
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();
            }
        }