Beispiel #1
0
	public void SubmitForm()
	{
		TextCallback callback = new TextCallback(Localization.Instance.Localize("login.text.loggingin"));
		UIController.Instance.OpenPopup<bool>(Popup.StatusPopup, callback);
		client.Login(username.text, password.text);
		UIController.Instance.CloseUIWindow(UIWindow.Login);
	}
Beispiel #2
0
	private void Client_OnLoginFailure(string message)
	{
		UIController.Instance.ClosePopup(Popup.StatusPopup);
		TextCallback callback = new TextCallback(message);
		UIController.Instance.OpenPopup<bool>(Popup.TextPopup, callback);
		UIController.Instance.OpenUIWindow(UIWindow.Login);

		Debug.Log("Login failed: " + message);
	}
        internal void ShowCombo <D>(ComboBox combo, List <D> items, TextCallback <D> text, ValueCallback <D> value, int selectedIndex)
        {
            combo.Items.Clear();

            var data = new List <dynamic>();

            items.ForEach((item) => data.Add(new { Text = text(item), Value = value(item) }));

            combo.DataSource = data;
        }
Beispiel #4
0
 private void AddLog(String line)
 {
     if (this.txtLog.InvokeRequired)
     {
         TextCallback d = AddLog;
         this.Invoke(d, new object[] { Environment.NewLine + String.Format("{0}: {1}", DateTime.Now.ToLongTimeString(), line) });
     }
     else
     {
         txtLog.AppendText(Environment.NewLine + String.Format("{0}: {1}", DateTime.Now.ToLongTimeString(), line));
     }
 }
Beispiel #5
0
 private void SetProgressValue(string currentvalue)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.label1.InvokeRequired)
     {
         TextCallback cb = new TextCallback(SetProgressValue);
         this.Invoke(cb, new object[] { currentvalue });
     }
     else
     {
         this.label1.Text = currentvalue + "/" + this.label1.Tag.ToString();
     }
 }
Beispiel #6
0
 public DebugConnection(TextCallback textCallback, int id)
 {
     mTextCallback = textCallback;
     mID           = id;
 }
Beispiel #7
0
 public static void setTextCallback(TextCallback textCallback)
 {
     mTextCallback = textCallback;
 }
Beispiel #8
0
 private static extern void SetCallback(IntPtr obj, TextCallback callback);
 public SocketConnection(TextCallback textCallback)
 {
     _textCallback = textCallback;
 }
Beispiel #10
0
 public void Register(string key, TextCallback callback)
 {
     // TODO: precalc
     this.methods[key] = (DrawingSurface ds, string text, DrawingSurface.Options options) => ds.Text(callback(), options);
 }
Beispiel #11
0
 private void AddLog(String line)
 {
     if (this.txtLog.InvokeRequired)
     {
         TextCallback d = new TextCallback(AddLog);
         this.Invoke(d, new object[] { 
             Environment.NewLine + String.Format("{0}: {1}", DateTime.Now.ToLongTimeString(), line) });
     }
     else
     {
         txtLog.AppendText(Environment.NewLine + String.Format("{0}: {1}", DateTime.Now.ToLongTimeString(), line));
     }
 }
Beispiel #12
0
 public SocketConnection(TextCallback textCallback)
 {
     _textCallback = textCallback;
 }