public BaseDemoControl GetDemo(IDbConnection connection, WriteStatusHandler handler) { if (demoControl == null) { demoControl = CreateDemoControl(connection); demoControl.WriteStatus += handler; } return(demoControl); }
private void RefreshClientArea() { Demo currentDemo = GetCurrentDemo(); statusBar.Panels[1].Text = ""; statusBar.Panels[2].Text = ""; //what button is pushed? if (btDemo.Pushed) { BaseDemoControl demos = currentDemo.GetDemo(connection, new WriteStatusHandler(OnWriteStatus)); this.pnDemo.Controls.Clear(); demos.Parent = this.pnDemo; demos.Dock = System.Windows.Forms.DockStyle.Fill; OnWriteStatus(demos); } else if (btSource.Pushed) { string fullPath = currentDemo.CodeFileName; if (File.Exists(fullPath)) { using (StreamReader sr = new StreamReader(fullPath)) { tbSource.Text = sr.ReadToEnd(); } } } else if (btSql.Pushed) { textSql.Text = (btCreate.Pushed ? currentDemo.CreateSql : currentDemo.DropSql); if (textSql.Text == "") { textSql.Text = (btCreate.Pushed ? createSqlText : dropSqlText); } } else if (btDescription.Pushed) { object o = new Object(); currentDemo.GenerateReadMe(tempHtmlFile); webDescription.Navigate(tempHtmlFile, ref o, ref o, ref o, ref o); } }
protected void OnWriteStatus(BaseDemoControl control) { statusBar.Panels[1].Text = control.WriteStatus1; statusBar.Panels[2].Text = control.WriteStatus2; }