private void dCookie() { try { while (isWorking) { Thread.Sleep(500); Invoke(new Action(() => { try { string cookie = wcChoose.Source.AbsoluteUri.Substring( wcChoose.Source.AbsoluteUri.IndexOf("?q=" + "")); if (cookie != "") { string curDir = Directory.GetCurrentDirectory(); if (cookie == "?q=1") { TheoryForm f = new TheoryForm(); f.Show(); Visible = false; } if (cookie == "?q=2") { string path = String.Format(@"{0}\Tests\Лёгкий тест.json", curDir); TestForm f = new TestForm("Лёгкий тест", path); f.Show(); Visible = false; } if (cookie == "?q=3") { string path = String.Format(@"{0}\Tests\Сложный тест.json", curDir); TestForm f = new TestForm("Сложный тест", path); f.Show(); Visible = false; } if (cookie == "?q=4") { string path = String.Format(@"{0}\Tests\Технический тест.json", curDir); TestForm f = new TestForm("Технический тест", path); f.Show(); Visible = false; } if (cookie == "?q=5") { FormDiagram f = new FormDiagram(); f.Show(); Visible = false; } isWorking = false; } } catch { } })); } } catch {} }
private void TheoryPanel_Click(object sender, EventArgs e) { var frm = new TheoryForm(); frm.Closed += (s, args) => this.Show(); frm.Show(); Hide(); }