private async Task SaveCode(object sender) { // get tag of module to deploy string tag = (sender as Button).Tag.ToString(); // update that module with the updated code Debug.Out("Saving \"" + tag + "\" module...", "CORE MODULES"); CoreManager.Modules[CoreManager.Modules.IndexOf(CoreManager.GetModuleByTag(tag))] = new CoreModule(tag, GetTextBoxByTag(tag).Text); // save changes await CoreManager.Save(); }
private void Page_Loaded(object sender, RoutedEventArgs e) { // set text for every TextBox foreach (string tag in Tags) { if (CoreManager.GetModuleByTag(tag) == null) { GetTextBoxByTag(tag).Text = ""; } else { GetTextBoxByTag(tag).Text = CoreManager.GetModuleByTag(tag).Code; } } }