private IEnumerator <IAsyncResult> SetPropertiesImpl(AccountPropertyNames propertyNames, IAccountCondition conditions, AsyncIteratorContext <NoResults> context) { IStringDataEventStream infoDebug = Logger <INormalAndDebugLogger> .Instance.InfoDebug; object[] objArray = new object[] { propertyNames, conditions, this.Timeout }; infoDebug.Log("SetPropertiesImpl({0},{1},{2})", objArray); IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan param0) => { using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext()) { StorageStampHelpers.CheckAccountName(this._account.Name); Account value = this.LoadAccount(dbContext); this._account = value; AnalyticsSettings analyticsSetting = null; AnalyticsSettings blobAnalyticsSettings = null; AccountServiceMetadataPropertyNames serviceMetadataPropertyNames = propertyNames.ServiceMetadataPropertyNames; if (serviceMetadataPropertyNames <= AccountServiceMetadataPropertyNames.QueueAnalyticsSettings) { if (serviceMetadataPropertyNames == AccountServiceMetadataPropertyNames.BlobAnalyticsSettings) { blobAnalyticsSettings = this.ServiceMetadata.BlobAnalyticsSettings; if (blobAnalyticsSettings != null) { if (value.BlobServiceSettings != null) { analyticsSetting = ServiceSettingsSerializer.DeSerialize(value.BlobServiceSettings); this.PreserveUnchangedAnalyticsSettings(blobAnalyticsSettings, analyticsSetting); } value.BlobServiceSettings = ServiceSettingsSerializer.Serialize(blobAnalyticsSettings); dbContext.SubmitChanges(); } } else if (serviceMetadataPropertyNames == AccountServiceMetadataPropertyNames.QueueAnalyticsSettings) { blobAnalyticsSettings = this.ServiceMetadata.QueueAnalyticsSettings; if (blobAnalyticsSettings != null) { if (value.QueueServiceSettings != null) { analyticsSetting = ServiceSettingsSerializer.DeSerialize(value.QueueServiceSettings); this.PreserveUnchangedAnalyticsSettings(blobAnalyticsSettings, analyticsSetting); } value.QueueServiceSettings = ServiceSettingsSerializer.Serialize(blobAnalyticsSettings); dbContext.SubmitChanges(); } } } else if (serviceMetadataPropertyNames == AccountServiceMetadataPropertyNames.TableAnalyticsSettings) { blobAnalyticsSettings = this.ServiceMetadata.TableAnalyticsSettings; if (blobAnalyticsSettings != null) { if (value.TableServiceSettings != null) { analyticsSetting = ServiceSettingsSerializer.DeSerialize(value.TableServiceSettings); this.PreserveUnchangedAnalyticsSettings(blobAnalyticsSettings, analyticsSetting); } value.TableServiceSettings = ServiceSettingsSerializer.Serialize(blobAnalyticsSettings); dbContext.SubmitChanges(); } } else if (serviceMetadataPropertyNames == AccountServiceMetadataPropertyNames.SecondaryReadEnabled) { bool?secondaryReadEnabled = this.ServiceMetadata.SecondaryReadEnabled; if (secondaryReadEnabled.HasValue) { value.SecondaryReadEnabled = secondaryReadEnabled.Value; dbContext.SubmitChanges(); } } } }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("StorageAccount.SetPropertiesImpl")); yield return(asyncResult); this.StorageManager.AsyncProcessor.EndExecute(asyncResult); }
public AccountPropertyNames(AccountLevelPropertyNames propertyNames, AccountServiceMetadataPropertyNames serviceMetadataPropertyNames) { this.PropertyNames = propertyNames; this.ServiceMetadataPropertyNames = serviceMetadataPropertyNames; }