public static bool TryParse(out CloudStorageAccountEx accountEx, params string[] connectionStrings)
        {
            if (connectionStrings == null)
            {
                throw new ArgumentNullException(nameof(connectionStrings));
            }

            if (connectionStrings.Length == 0)
            {
                throw new ArgumentException(nameof(connectionStrings));
            }


            bool result = true;

            CloudStorageAccount[] accounts = new CloudStorageAccount[connectionStrings.Length];
            for (int i = 0; i < connectionStrings.Length; i++)
            {
                CloudStorageAccount account;
                result &= CloudStorageAccount.TryParse(connectionStrings[i], out account);

                accounts[i] = account;
            }

            accountEx = (result)
                ? new CloudStorageAccountEx(accounts)
                : null;
            return(result);
        }
        public static CloudStorageAccountEx Parse(params string[] connectionStrings)
        {
            if (connectionStrings == null)
            {
                throw new ArgumentNullException(nameof(connectionStrings));
            }

            if (connectionStrings.Length == 0)
            {
                throw new ArgumentException(nameof(connectionStrings));
            }


            CloudStorageAccount[] accounts = new CloudStorageAccount[connectionStrings.Length];
            for (int i = 0; i < connectionStrings.Length; i++)
            {
                CloudStorageAccount account;
                account = CloudStorageAccount.Parse(connectionStrings[i]);

                accounts[i] = account;
            }

            CloudStorageAccountEx accountEx = new CloudStorageAccountEx(accounts);

            return(accountEx);
        }
コード例 #3
0
        internal CloudBlobClientEx(CloudStorageAccountEx cloudStorageAccount, Func <CloudStorageAccount, CloudBlobClient> ctorFunc)
        {
            if (cloudStorageAccount == null)
            {
                throw new ArgumentNullException(nameof(cloudStorageAccount));
            }

            if (ctorFunc == null)
            {
                throw new ArgumentNullException(nameof(ctorFunc));
            }


            this.cloudStorageAccount = cloudStorageAccount;
            this.failoverContainer   = ((IFailoverContainerContainerProvider <CloudStorageAccount>)cloudStorageAccount)
                                       .FailoverContainer.CreateChildContainer(ctorFunc);
        }