private void editServer_Click(object sender, EventArgs e) { if (serverListCombo.Items.Count < 1) { MessageBox.Show("No saved server to edit!"); return; } AddServer firstTime = new AddServer(this,serverListCombo.SelectedIndex); firstTime.StartPosition = FormStartPosition.Manual; firstTime.Location = new Point(this.Location.X + (this.Width - firstTime.Width) / 2, this.Location.Y + (this.Height - firstTime.Height) / 2); firstTime.Show(this); }
public MainForm() { InitializeComponent(); pr = new Progress(this); show = new ShowProgressDelegate(ShowProgress); update = new UpdateProgressDelegate(UpdateProgress); ShowProgress(false,false); //cboxVer.SelectedIndex = 0; addToStatusLog("Init()"); //local folder path string path=""; if (NFSClient.Properties.Settings.Default.DefaultLocalFolder== "home") path = (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) ? Environment.GetEnvironmentVariable("HOME") : Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%"); else path = NFSClient.Properties.Settings.Default.DefaultLocalFolder; RefreshLocal(path); if (NFSClient.Properties.Settings.Default.ServerName.Length > 0) { //serverListCombo.Items.AddRange(NFSClient.Properties.Settings.Default.ServerName); int i = 0; foreach (string item in NFSClient.Properties.Settings.Default.ServerName) { serverListCombo.Items.Add(item + " (" + NFSClient.Properties.Settings.Default.ServerAddres[i] + "@" + NFSClient.Properties.Settings.Default.DefaultProtocol[i]+ ")"); i++; } server_index = NFSClient.Properties.Settings.Default.lastServerId; serverListCombo.SelectedIndex = server_index; //auto connect if (NFSClient.Properties.Settings.Default.autoConnect) connect(); } else { AddServer firstTime = new AddServer(this,-1); firstTime.StartPosition = FormStartPosition.Manual; firstTime.Location = new Point(this.Location.X + (this.Width - firstTime.Width) / 2, this.Location.Y + (this.Height - firstTime.Height) / 2); firstTime.Show(this); } }
private void addServer_Click(object sender, EventArgs e) { AddServer firstTime = new AddServer(this,-1); firstTime.StartPosition = FormStartPosition.Manual; firstTime.Location = new Point(this.Location.X + (this.Width - firstTime.Width) / 2, this.Location.Y + (this.Height - firstTime.Height) / 2); firstTime.Show(this); }