void HandlePeriodsClicked(object sender, EventArgs e) { string res, desc; List <string> periods; desc = Catalog.GetString("Game periods") + " (eg: 1 2 ex1 ex2) "; res = MessagesHelpers.QueryMessage(this, desc, "", String.Join(" ", Template.GamePeriods)); if (res == null) { return; } periods = new List <string> (res.Split(' ')); if (periods.Count == 0) { string msg = Catalog.GetString("Invalid content. Periods must be separated by spaces " + "(\"1 2 ex1 ex2\")"); MessagesHelpers.ErrorMessage(this, msg); } else { Template.GamePeriods = periods; periodsLabel.Text = String.Join(" - ", periods); } }
public string QueryMessage(string key, string title = null, string value = "", object parent = null) { if (parent == null) { parent = mainWindow; } return(MessagesHelpers.QueryMessage(parent as Widget, key, title, value)); }
protected void OnAddbuttonClicked(object sender, System.EventArgs e) { IDatabase db; string dbname = MessagesHelpers.QueryMessage(this, Catalog.GetString("Database name")); if (dbname == null || dbname == "") { return; } if (manager.Databases.Where(d => d.Name == dbname).Count() != 0) { var msg = Catalog.GetString("A database already exists with this name"); MessagesHelpers.ErrorMessage(this, msg); return; } db = manager.Add(dbname); if (db != null) { store.AppendValues(db); } }
void EditText(Text text) { text.Value = MessagesHelpers.QueryMessage(this, Catalog.GetString("Text"), null, text.Value); QueueDraw(); }
public Task <string> QueryMessage(string key, string title = null, string value = "", object parent = null) { string res = MessagesHelpers.QueryMessage(GetParentWidget(parent), key, title, value); return(AsyncHelpers.Return(res)); }