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); }
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; }
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); } }
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); } } }