예제 #1
0
 protected override void OnActivated(EventArgs e)
 {
     base.OnActivated(e);
     var server = new JabbRServer { Name = "JabbR.net", Address = "https://jabbr.net", JanrainAppName = "jabbr" };
     using (var dialog = new ServerDialog(server, true, true))
     {
         dialog.DisplayMode = DialogDisplayMode.Attached;
         var ret = dialog.ShowDialog(Application.Instance.MainForm);
         if (ret == DialogResult.Ok)
         {
             Debug.WriteLine("Added Server, Name: {0}", server.Name);
             var config = JabbRApplication.Instance.Configuration;
             config.AddServer(server);
             JabbRApplication.Instance.SaveConfiguration();
             if (AutoConnect)
             {
                 Application.Instance.AsyncInvoke(delegate
                 {
                     server.Connect();
                 });
             }
         }
     }
     
 }
예제 #2
0
		protected override void OnActivated (EventArgs e)
		{
			base.OnActivated (e);
			var server = channels.SelectedServer;
			if (server != null) {
				using (var dialog = new ServerDialog(server, false, true)) {
					dialog.DisplayMode = DialogDisplayMode.Attached;
					var ret = dialog.ShowDialog (Application.Instance.MainForm);
					if (ret == DialogResult.Ok) {
						JabbRApplication.Instance.SaveConfiguration ();
						Debug.WriteLine (string.Format ("Edited Server, Name: {0}", server.Name));
					}
				}
			}
		}
예제 #3
0
 public override bool Authenticate(Control parent)
 {
     if (this.UseSocialLogin)
     {
         var dlg = new JabbRAuthDialog(this.Address, this.JanrainAppName);
         var result = dlg.ShowDialog(parent);
         if (result == DialogResult.Ok)
         {
             this.UserId = dlg.UserID;
             return true;
         }
     }
     else
     {
         var dialog = new ServerDialog(this, false, false);
         dialog.DisplayMode = DialogDisplayMode.Attached;
         var ret = dialog.ShowDialog(Application.Instance.MainForm);
         return ret == DialogResult.Ok;
     }
     return false;
 }