Пример #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 (UseSocialLogin)
     {
         var dlg = new JabbRAuthDialog(Address, JanrainAppName);
         var result = dlg.ShowDialog(parent);
         if (result == DialogResult.Ok)
         {
             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;
 }