Ejemplo n.º 1
0
        public void Run()
        {
            while (true)
            {
                try
                {
                    GRule    gRule = null;
                    string[] files = GRule.GetFiles();
                    for (int i = 0; i < files.Length; i++)
                    {
                        gRule = FileParser.Reads <GRule>(files[i]);
                        callbackProgressBar(0.0);
                        Stack <string> messagesId = null;
                        messagesId = gMessage.GetMessages(GMessage.Query(gRule), ref gRule.lastMesId);
                        //callbackAlert(false);
                        if (messagesId.Count > 0)
                        {
                            foreach (string id in messagesId)
                            {
                                gMessage.GetFile(id, ref gRule, callbackFileName, callbackProgressBar);
                                FileParser.Write(gRule.GetFilePath(), gRule);
                            }
                        }
                        gMessage.ResetParametres();
                    }
                }
                catch (Exception)
                {
                    //if (MessageBox.Show("Message download error!!!! pidr sykkkkaaaa", "Exception") == DialogResult.OK) { };

                    /*
                     * if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
                     *  callbackAlert(true);
                     */
                }
            }
        }
Ejemplo n.º 2
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();
        }