public static void SaveServer(ServerEntry entry) { ClientData.SaveOrUpdate (entry); }
public static void DeleteServer(ServerEntry entry) { ClientData.Delete (entry); }
public void Connect (ServerEntry connectTo) { if (String.IsNullOrEmpty (connectTo.UserNickname)) { /*InputForm nickname = new InputForm(); if (nickname.ShowDialog () == DialogResult.Cancel) return; string nick = nickname.Input.Text.Trim(); connectTo.UserNickname = nick;*/ connectTo.UserNickname = Settings.Nickname; } this.server = connectTo; this.users.Server = connectTo; Connect (); }
private async void startLocal_Click (object sender, EventArgs e) { string nick; if (Settings.Nickname == null) { InputForm nickname = new InputForm(); if (nickname.ShowDialogOnFormThread (this) == DialogResult.Cancel) return; nick = nickname.Input.Text.Trim(); } else nick = Settings.Nickname; await LocalServer.StartAsync(); this.DialogResult = DialogResult.OK; this.Entry = new ServerEntry (0) { Host = Target.LoopbackIP, Port = 42912, UserName = nick, UserNickname = nick, UserPassword = "******" }; }
private void btnSaveServer_Click (object sender, EventArgs e) { if (!ValidateChildren (ValidationConstraints.Visible)) return; if (this.Entry == null) this.Entry = new ServerEntry(0); this.Entry.Name = this.inName.Text.Trim(); this.Entry.Host = this.inServer.Text.Trim(); this.Entry.Port = Int32.Parse (this.inPort.Text.Trim()); this.Entry.ServerPassword = this.inServerPassword.Text.Trim(); this.Entry.UserNickname = this.inNickname.Text.Trim(); this.Entry.UserPhonetic = this.inPhonetic.Text.Trim(); this.Entry.UserName = this.inUsername.Text.Trim(); this.Entry.UserPassword = this.inPassword.Text.Trim(); Servers.SaveServer (Entry); Program.UpdateTaskbarServers(); this.ClearEdit(); this.LoadServerEntries(); }
private void servers_SelectedIndexChanged (object sender, EventArgs e) { switch (this.servers.SelectedItems.Count) { case 0: this.ShowAddServer(); this.btnConnect.Enabled = false; this.Entry = null; break; case 1: this.ShowEditServer(); this.btnConnect.Enabled = true; this.Entry = this.servers.SelectedItems[0].Tag as ServerEntry; break; default: this.btnConnect.Enabled = false; this.btnAddServer.Enabled = false; this.Entry = null; break; } }