public override void OnExecuted(EventArgs e) { base.OnExecuted(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(); }); } } } }
public JabbRServerEdit(JabbRServer server, DynamicLayout layout) { this.server = server; layout.AddRow(new Label { Text = "Address" }, EditAddress()); layout.EndBeginVertical(yscale: true); layout.AddRow(UseSocialLogin()); layout.Add(authSection = new Panel { }, yscale: true); layout.EndBeginVertical(); loginSection = LoginSection(); socialSection = SocialSection(); authSection.DataContextChanged += (sender, e) => SetVisibility(); SetVisibility(); }