Пример #1
0
        private void Form5_View_Group_Load(object sender, EventArgs e)
        {
            FileReadWrite.path = FileReadWrite.GetCurrentDirectoryPath + "\\Data\\Group Names.txt";

            FileReadWrite.LoadDataFromFileInComboBox(comboBox_Group_Name);

            comboBox_Group_Name.SelectedIndex = 0;
        }
Пример #2
0
        private void add_multiple_contacts_Click(object sender, EventArgs e)
        {
            Add_Multiple_Contacts AMC = new Add_Multiple_Contacts();

            AMC.ShowDialog();

            // Loading group names in combobox
            FileReadWrite.path = FileReadWrite.GetCurrentDirectoryPath + "\\Data\\Group Names.txt";

            comboBox_to.Items.Clear();
            FileReadWrite.LoadDataFromFileInComboBox(comboBox_to);
        }
Пример #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (!CheckForInternetConnection())   //Check for "system is not connected to the internet" is true
            {
                MessageBox.Show("No Internet Connection. Data will be saved offline.", "No Internet", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            System.Windows.Forms.Label l1 = new System.Windows.Forms.Label();
            l1.Text     = "Application is Loading. Please Wait ...";
            l1.AutoSize = true;
            l1.Location = new Point(20, 20);

            Form f1 = new Form();

            f1.Width         = 500;
            f1.Height        = 100;
            f1.StartPosition = FormStartPosition.CenterScreen;
            f1.Controls.Add(l1);
            f1.BackColor   = Color.Linen;
            f1.MinimizeBox = false;
            f1.MaximizeBox = false;
            f1.Show();

            //   UserCredential credential;
            try
            {
                using (var stream =
                           new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
                {
                    credPath = System.Environment.GetFolderPath(
                        System.Environment.SpecialFolder.Personal);
                    credPath = Path.Combine(credPath, ".credentials/main");

                    credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                        GoogleClientSecrets.Load(stream).Secrets,
                        Scopes,
                        "user",
                        CancellationToken.None,
                        new FileDataStore(credPath, true)).Result;
                }
                f1.Close();
                MessageBox.Show("Authorization Completed Successfully", "Mail Client Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception t)
            {
                MessageBox.Show("Authorization Failed\n" + t.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }


            System.Drawing.Color y = Color.FromArgb(31, 65, 119);
            //label_step1.ForeColor = y;
            //label_step2.ForeColor = y;
            label_to.ForeColor      = y;
            label_subject.ForeColor = y;
            label_content.ForeColor = y;

            button_authorize.FlatAppearance.BorderColor = y;
            button_authorize.ForeColor = y;

            button_edit_group_list.FlatAppearance.BorderColor = y;
            button_edit_group_list.ForeColor = y;

            button_send_mail.FlatAppearance.BorderColor = y;
            button_send_mail.ForeColor = y;

            button_clear.FlatAppearance.BorderColor = y;
            button_clear.ForeColor = y;

            button_exit.FlatAppearance.BorderColor = y;
            button_exit.ForeColor = y;

            send_mail_menu.ForeColor = y;

            comboBox_to.ForeColor = y;

            textBox_subject.ForeColor = y;

            richTextBox_content.ForeColor = y;

            System.Drawing.Color x = Color.FromArgb(140, 197, 67);
            //menuStrip1.BackColor = x;

            // Loading
            FileReadWrite.path = FileReadWrite.GetCurrentDirectoryPath + "\\Data\\Group Names.txt";

            FileReadWrite.LoadDataFromFileInComboBox(comboBox_to);

            // Reading Total Mail Sent Quota and storing in variable
            string path1 = FileReadWrite.GetCurrentDirectoryPath + "\\Data\\Total Mails Sent Quota.txt";

            //Open the file to read from.
            using (StreamReader sr = File.OpenText(path1))
            {
                Total_Mail_Sent = Convert.ToInt32(sr.ReadLine());
            }
        }
Пример #4
0
 private void comboBox_to_DropDown(object sender, EventArgs e)
 {
     comboBox_to.Items.Clear();
     FileReadWrite.LoadDataFromFileInComboBox(comboBox_to);
 }