Ejemplo n.º 1
0
        internal async Task ExecuteAsync(BrowserForm pForm)
        {
            string CMD = $"document.styleSheets[{Rule.parentIndex}].cssRules[{Rule.index}].style.";

            CMD += Edit;
            Debug.Print(CMD);
            string S = await pForm.ExecJSAsync(CMD);

            Debug.Print(S);
        }
Ejemplo n.º 2
0
        UnPackAsync(BrowserForm form)
        {
            string S;

            pForm = form;

            S = await form.ExecJSAsync($"(function() {{ return document.styleSheets[{parentIndex}].cssRules[{index}].cssText}})();");

            cssText = S;
            S       = await form.ExecJSAsync($"(function() {{ return document.styleSheets[{parentIndex}].cssRules[{index}].selectorText}})();");

            selectorText = S;
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (browserForm is null)
            {
                browserForm = new BrowserForm(jsHandler);
            }
            browserForm.URL = GenerateURL();
            try
            {
                browserForm.Show();
//                timer1.Enabled = true;
            }
            catch (ObjectDisposedException ex)
            {
                // they closed the form... reset and try a new one
                browserForm = null;
                button1_Click(sender, e);
            }
        }
Ejemplo n.º 4
0
        public async void UnPackAsync(BrowserForm form)
        {
            int    NumStyles = 0;
            string S;

            S = await form.ExecJSAsync($"(function() {{ return document.styleSheets[{index}].cssRules.length}})();");

            NumStyles = Int32.Parse(S);
            if (NumStyles > 0)
            {
                S = await form.ExecJSAsync($"(function() {{ return document.styleSheets[{index}].href}})();");

                href     = S;
                cssRules = new StyleSheetRule[NumStyles];
                Debug.Print(S);
                for (int j = 0; j < NumStyles; j++)
                {
                    cssRules[j] = new StyleSheetRule(index, j);
                    await cssRules[j].UnPackAsync(form);
                }
            }
        }