Example #1
0
        public FormMailTrigger()
        {
            InitializeComponent();
            this.Show();
            fmtl = new FormMailTriggerLogic();

            //Act.DataLoginAct.Read();

            UserData.Init().Email = "oleg";
            tb_mail.Text = UserData.GetUserData().Email;

            DataLoginModel dataLogin = new DataLoginModel("*****@*****.**", "1234");

            GLogin.Init();
            GLogin.Glogin.CreateGmailService();
            GMessage gMessage = new GMessage(GLogin.Glogin.GmailService, dataLogin);

            string str = gMessage.GetMessageRaw(gMessage.Find(new GRule("TestTag", "testpath"), gMessage.GetMessages()));



            //UserData.GetUserData().CreateGmailService();
            //UserData.GetUserData().ListMessagesMatchungQuerty(UserData.GetUserData().GmailService, "me", String.Empty);



            //Google.Apis.Gmail.v1.Data.Message mes = UserData.GetMessage(UserData.GetUserData().GmailService, "*****@*****.**", "0");
            //tb_mail.Text = mes.Payload.Headers.ToString();
        }
Example #2
0
        private async void FormMailTriggerLogic_Load(object sender, EventArgs e)
        {
            this.notifyIcon.Icon = new Icon(Application.StartupPath + "\\" + "MTP-beta-icon.ico");
            this.notifyIcon.Text = "Mail Trigger Parser";

            if (GLogin.Glogin == null)
            {
                GLogin.Init();
                await GLogin.Glogin.CreateCredential();

                GLogin.Glogin.CreateGmailService();
            }

            gMessage = new GMessage(GLogin.Glogin.GmailService);

            calculate = new Calculate(GLogin.Glogin.GmailService);
            calculate.callbackFileName    += Calculate_callbackFileName;
            calculate.callbackProgressBar += Calculate_callbackProgressBar;
            calculate.callbackAlert       += Calculate_callbackAlert;

            this.Deactivate += FormMailTriggerLogic_Deactivate;

            if (AutoRun.IsEnabled())
            {
                btn_start.Enabled = false;
                btn_stop.Enabled  = true;
                thread            = new Thread(new ThreadStart(calculate.Run));
                thread.Start();

                cb_autorun.Checked = true;
                this.WindowState   = FormWindowState.Minimized;
                this.ShowInTaskbar = false;
            }
            else
            {
                btn_stop.Enabled   = false;
                cb_autorun.Checked = false;
            }


            dataGridView.Rows.Clear();

            l_version.Text = /* "Version : " + */ "beta " + Application.ProductVersion.ToString();
            var data = await GLogin.Glogin.GmailService.Users.GetProfile("me").ExecuteAsync();

            l_mail.Text              = data.EmailAddress;
            l_status.Text            = "tap start";
            l_processedMessages.Text = "0";

            foreach (string str in GRule.GetFiles())
            {
                RowAdd(FileParser.Reads <GRule>(str));
            }
            GRule.SetChange(false);

            this.Select();
        }
Example #3
0
 private async void FormMailTrigger_Load(object sender, EventArgs e)
 {
     GLogin.Init();
     //while (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
     if (Act.AutoRun.IsEnabled())
     {
         this.Opacity       = 0.0f;
         this.ShowInTaskbar = false;
     }
 }