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;
}