public void ImportNetworkItem(NetworkItem item) { txtDisplayName.Text = item.DisplayName; txtAddress.Text = item.ServerAddress; txtUsername.Text = item.Username; txtPassword.Text = item.Password; chkAnonymous.IsChecked = item.AnonymousLogin; switch (item.AccountService) { case AccountService.FTP: ServerType.SelectedIndex = 0; chkPassive.IsChecked = (item as FTPServer).PassiveMode; txtPort.Text = item.Port.ToString(); break; case AccountService.FTPS: ServerType.SelectedIndex = 1; chkPassive.IsChecked = (item as FTPSServer).PassiveMode; txtPort.Text = item.Port.ToString(); break; case AccountService.WebDAV: ServerType.SelectedIndex = 2; break; default: throw new ArgumentOutOfRangeException("item", "This is not a valid type of Network item."); } }
public void LoadFromNetworkItem(NetworkItem item) { txtDisplayName.Text = item.DisplayName; txtAddress.Text = item.ServerAddress; switch (item.AccountService) { case AccountService.FTP: txtType.Text = "FTP"; break; case AccountService.FTPS: txtType.Text = "FTPS"; break; case AccountService.WebDAV: txtType.Text = "WebDAV"; break; default: throw new ArgumentOutOfRangeException("item", "This is not a valid type of Network item."); } txtUsername.Text = item.AnonymousLogin ? "Anonymous" : item.Username; _item = item; }
public NetworkItemEventArgs(NetworkItem item = null) { NetworkItem = item; }