Ejemplo n.º 1
0
        private void LoadAccounts(Models.EStorageAccountType accountType)
        {
            switch (accountType)
            {
            case Models.EStorageAccountType.AmazonS3:
            {
                if (this.cbAmazonS3.Items.Count > 0)
                {
                    return;
                }

                var accounts = _s3dao.GetAll();
                accounts.Insert(0, new Models.AmazonS3Account()
                    {
                        DisplayName = "<Create new account>"
                    });

                this.cbAmazonS3.DisplayMember = this.GetPropertyName((Models.AmazonS3Account x) => x.DisplayName);
                this.cbAmazonS3.ValueMember   = this.GetPropertyName((Models.AmazonS3Account x) => x.Id);
                this.cbAmazonS3.DataSource    = accounts;
                break;
            }

            case Models.EStorageAccountType.FileSystem:
            {
                if (this.cbFileSystem.Items.Count > 0)
                {
                    return;
                }
                //var accounts = null;
                //accounts.Insert(0, new FileSystemAccount() { DisplayName = "<Create new account>" });
                break;
            }
            }
        }
Ejemplo n.º 2
0
        protected void LoadAccounts()
        {
            this.lvAccounts.Items.Clear();

            var accounts = _s3dao.GetAll();

            foreach (var account in accounts)
            {
                ListViewItem item = new ListViewItem(account.DisplayName, 0);
                item.Tag = account.Id;
                lvAccounts.Items.Add(item);
            }
        }