protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); // Pull Exposed Managers System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(Page.Server.MapPath("~/bin")); ManagerCore managerCore = ManagerCore.GetInstance(); if (!managerCore.IsInitialized) { managerCore.ConnectionString = this.ConnectionString; managerCore.Initialize(dir.GetFiles("*.dll")); } if (message != string.Empty) { Page.ClientScript.RegisterStartupScript(typeof(string), "Error", "<script language=\"javascript\">\r\n" + "<!--\r\n" + "alert(\"" + message + "\")\r\n" + "//-->\r\n" + ";</script>\r\n"); } }
public App() { InitializeComponent(); this.Taskbar = new NotifyIcon(); this.Taskbar.Icon = new Icon("Main.ico"); this.Taskbar.Visible = true; this.Taskbar.DoubleClick += (sender, args) => { this.show(); }; var menu = new ContextMenu(); MenuItem mnuShow = new MenuItem("Show..."); MenuItem mnuClose = new MenuItem("Close"); menu.MenuItems.Add(mnuShow); menu.MenuItems.Add(mnuClose); mnuShow.Click += (sender, e) => { this.show(); }; mnuClose.Click += (sender, e) => { this.Close(); }; this.Taskbar.ContextMenu = menu; this.Core = new ManagerCore(); this.Core.Init(); }
protected override void OnNewClicked(EventArgs e) { ManagerCore managerCore = ManagerCore.GetInstance(); ExposedManagerCollection managers = managerCore.ExposedManagers; try { managers[selectedID].Manager.CreateTable(); message = managers[selectedID].Name + " is OK."; } catch (Exception ex) { message = ex.Message; } }
public override void ProcessCommand(string command, string parameters) { ManagerCore managerCore; ExposedManagerCollection managers; string report; if (command == "Verify") { managerCore = ManagerCore.GetInstance(); managers = managerCore.ExposedManagers; report = managers[selectedID].Manager.VerifyTable(true); if (report.Length == 0) { message = managers[selectedID].Name + " is OK."; } else { message = report; } } }
public Manager(ManagerCore services) { InitializeComponent(); this.services = services; }
/// <summary> /// Render this control to the output parameter specified. /// </summary> /// <param name="output"> The HTML writer to write out to </param> protected override void RenderContent(HtmlTextWriter output) { EnsureChildControls(); ManagerCore managerCore = ManagerCore.GetInstance(); ExposedManagerCollection managers = managerCore.ExposedManagers; StringCollection tables = MsJetUtility.GetTables(managerCore.ConnectionString); bool rowflag = false; string rowCssClass; bool exists; this.headerLockEnabled = true; RenderRow(this.HeaderRowCssClass, "Extension", "Version", "Exists"); // // Render Records // for (int i = 0; i < managers.Count; i++) { exists = false; foreach (string tableName in tables) { if (string.Equals(tableName, managers[i].Manager.TableName, StringComparison.CurrentCultureIgnoreCase)) { exists = true; break; } } if (rowflag) { rowCssClass = this.defaultRowCssClass; } else { rowCssClass = this.alternateRowCssClass; } rowflag = !rowflag; output.WriteBeginTag("tr"); output.WriteAttribute("i", i.ToString()); output.WriteLine(HtmlTextWriter.TagRightChar); output.Indent++; output.WriteBeginTag("td"); output.WriteAttribute("valign", "top"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write("<strong>"); output.Write(managers[i].Name); output.Write("</strong><span style=\"color:#bbbbbb;\"> - "); output.Write(managers[i].Manager.TableName); output.Write("</span><br /><em>"); output.Write(managers[i].Description); output.Write("</em>"); output.WriteEndTag("td"); output.WriteLine(); output.WriteBeginTag("td"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); output.Write(managers[i].VersionMajor); output.Write("."); output.Write(managers[i].VersionMinor); output.Write("."); output.Write(managers[i].VersonBuild); output.WriteEndTag("td"); output.WriteLine(); // Display Existence output.WriteBeginTag("td"); output.WriteAttribute("class", rowCssClass); output.Write(HtmlTextWriter.TagRightChar); if (exists) { output.Write("yes"); } else { output.Write("no"); } output.WriteEndTag("td"); output.WriteLine(); output.Indent--; output.WriteEndTag("tr"); output.WriteLine(); } }