private void ConnectBtn_Click(object sender, EventArgs e) { myFTP = new MyFTP(); myFTP.Server = ServerBox.Text.Trim(); if (myFTP.Server.Length == 0) { ServerWarning.Visible = true; ServerBox.Focus(); return; } ServerWarning.Visible = false; myFTP.UserName = UserNameBox.Text.Trim(); if (myFTP.UserName.Length == 0) { UserWarning.Visible = true; UserNameBox.Focus(); return; } UserWarning.Visible = false; myFTP.Password = PwdBox.Text.Trim(); try { myFTP.Port = int.Parse(PortBox.Text); }catch { PortWarning.Visible = true; PortBoxLabel.Focus(); return; } PortWarning.Visible = false; RemoteTree.Nodes.Clear(); AddLog($"正在尝试连接 {myFTP.Server}:{myFTP.Port}......"); try { myFTP.Connect(); } catch (Exception ex) { AddLog("错误: " + ex.Message, 1); return; } AddLog($"FTP已连接到 {myFTP.Server}:{myFTP.Port}, 成功登录!"); Text = $"极简FTP [{myFTP.Server}:{myFTP.Port}]"; PreLoadRemoteTree(); }
public DatabaseManagerError() { CloseWindow.InputGestures.Add(new KeyGesture(Key.Escape)); CommandBindings.Add(new CommandBinding(CloseWindow, CloseCurrentWindow)); //SkinStorage.SetVisualStyle(this, Settings.Default.Theme); InitializeComponent(); ServerBox.Focus(); }
void IServerBoxObserver.NotifyServerBox(ServerBox box) { var boxZone = box.gameObject.AddComponent <DropZone>(); dropZones[box] = boxZone; var runOnServer = game.runner.actionCard.Run(box.server); abilities[box] = new InteractiveAbility(runOnServer, boxZone, game); droppable.Represent(abilities[box]); }
void IServerBoxObserver.NotifyServerBox(ServerBox box) { var boxZone = box.gameObject.AddComponent <DropZone>(); var ability = gameObject.AddComponent <DroppableAbility>(); dropZones[box] = boxZone; abilities[box] = ability; var runOnServer = game.runner.actionCard.Run(box.server); ability.Represent(runOnServer, game, boxZone); }
public ConnectionManager(MainWindow window) { CloseWindow.InputGestures.Add(new KeyGesture(Key.Escape)); CommandBindings.Add(new CommandBinding(CloseWindow, CloseCurrentWindow)); //SkinStorage.SetVisualStyle(this, Settings.Default.Theme); InitializeComponent(); ServerBox.Text = Settings.Default.Server; UserIDBox.Text = Settings.Default.UserID; DatabaseComboBox.Text = Settings.Default.Database; SchemaComboBox.Text = Settings.Default.Schema; ServerBox.Focus(); _window = window; Closed += (sender, args) => App.Restart(); }
void IServerBoxObserver.NotifyServerBoxDisappeared(ServerBox box) { Object.Destroy(dropZones[box]); Object.Destroy(abilities[box]); }
void IServerBoxObserver.NotifyServerBoxDisappeared(ServerBox box) { Object.Destroy(dropZones[box]); droppable.Unlink(abilities[box]); abilities.Remove(box); }