示例#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;
            }
            }
        }
示例#2
0
        private void SelectExistingAccount(Models.EStorageAccountType accountType, int?accountId)
        {
            switch (accountType)
            {
            case Models.EStorageAccountType.AmazonS3:
            {
                this.cbAmazonS3.SelectedValue = accountId;
                break;
            }

            case Models.EStorageAccountType.FileSystem:
            {
                this.cbFileSystem.SelectedValue = accountId;
                break;
            }
            }
        }