public void registerDefaultApps() { App execute = new App("Execute"); execute.package = "com.telekit.exec"; execute.executionName = "exec"; execute.icon = new Bitmap(Properties.Resources.wrench); execute.cursor = mainCursor; execute.mainForm = this.ejecutar; App settings = new App("Settings"); settings.executionName = "sett"; settings.package = "com.telekit.settings"; settings.icon = new Bitmap(Properties.Resources.wrench); settings.cursor = mainCursor; settings.mainForm = this.settings; App dictionary = new App("Dictionary"); dictionary.package = "com.telekit.dict"; dictionary.executionName = "dict"; dictionary.icon = new Bitmap(Properties.Resources.wrench); dictionary.cursor = mainCursor; dictionary.mainForm = new Diccionario(); AppsControl.Register(execute.getCompleteApp()); AppsControl.Register(settings.getCompleteApp()); AppsControl.Register(dictionary.getCompleteApp()); }
public void installApps() { // fileNames value is all files in softwareBaseDir variable string[] fileNames = Directory.GetDirectories(softwareBaseDir); foreach (string _appDir in fileNames) { string appDir = _appDir.Replace(softwareBaseDir + sep, ""); MessageBox.Show("Loading app " + appDir); App currentRegisteringApp = new App(); string currentAppDir = softwareBaseDir + sep + appDir; if (File.Exists(currentAppDir + sep + "info.nf")) { string[] infoFileLines = File.ReadAllLines(currentAppDir + sep + "info.nf"); foreach (string line in infoFileLines) { // This detects if is commented if (line.StartsWith("-->")) { continue; } // If line defines app name if (line.StartsWith("NM--")) { currentRegisteringApp.dispName = line.Replace("NM--", ""); } // If line defines app package if (line.StartsWith("PK--")) { currentRegisteringApp.package = line.Replace("PK--", ""); } // If line defines app mainForm if (line.StartsWith("MF--")) { currentRegisteringApp.mainForm = new Form(); } // If line defines app mainForm if (line.StartsWith("EN--")) { currentRegisteringApp.executionName = line.Replace("EN--", ""); } // If line defines app mainForm if (line.StartsWith("IC--")) { currentRegisteringApp.icon = Image.FromFile(currentAppDir + sep + "res" + sep + line.Replace("IC--", "")); } } AppsControl.Register(currentRegisteringApp); } else { continue; } } }