示例#1
0
        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);
            }
        }
示例#2
0
 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));
 }
示例#3
0
        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);
            }
        }
示例#4
0
 void EditText(Text text)
 {
     text.Value = MessagesHelpers.QueryMessage(this, Catalog.GetString("Text"),
                                               null, text.Value);
     QueueDraw();
 }
示例#5
0
文件: Dialogs.cs 项目: kuggaa/VAS
        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));
        }