Exemplo n.º 1
0
        private void BatDauLoadTinNhan()
        {
            //web.Reload();
            divLoadMore = (GeckoAnchorElement)web.Document.SelectFirst("//a[@class='touchable primary']");
            tm_XuLyTinNhan.Start();
            while (divLoadMore != null)
            {
                Application.DoEvents();
                isDangXuLyTinNhan = true;
                divLoadMore.Click();
                divLoadMore = (GeckoAnchorElement)web.Document.SelectFirst("//a[@class='touchable primary']");
                while (isDangXuLyTinNhan)
                {
                    Application.DoEvents();
                }
            }


            btnLoadTinNhan.Text = "Tải tin nhắn";
            isDangXuLyTinNhan   = false;
            divLoadMore         = null;
            TrangThaiDangTai(true);
            tm_XuLyTinNhan.Stop();

            ComponentFactory.Krypton.Toolkit.KryptonMessageBox.Show("Đã load hết nội dung tin nhắn!");
        }
        public void AddVoiceActions(GeckoDocument document, string tagName)
        {
            foreach (GeckoElement element in document.GetElementsByTagName(tagName))
            {
                VoiceAction action = new VoiceAction();
                action.label = element.TextContent.Trim();

                if (tagName == "button")
                {
                    action.task += () =>
                    {
                        GeckoButtonElement button = new GeckoButtonElement(element.DomObject);
                        button.Click();
                    };
                }

                if (tagName == "a")
                {
                    action.task += () =>
                    {
                        GeckoAnchorElement anchor = new GeckoAnchorElement(element.DomObject);
                        anchor.Click();
                    };
                }

                if (tagName == "iframe")
                {
                    action.task += () =>
                    {
                        GeckoButtonElement iframe = new GeckoButtonElement(element.DomObject);
                        iframe.Click();
                    };
                }
                actions.Add(action);
            }
        }