private void CreateFeatureManagerFactoryFromMailbox(OWAMiniRecipient miniRecipient) { UserConfigurationManager.IAggregationContext aggregationContext = null; try { this.LockAndReconnectMailboxSession(); aggregationContext = base.MailboxSession.UserConfigurationManager.AttachAggregator(AggregatedUserConfigurationSchema.Instance.OwaUserConfiguration); base.UnlockAndDisconnectMailboxSession(); OwaFlightConfigData owaFlightConfigData = UserContext.ReadAggregatedFlightConfigData(aggregationContext, base.ExchangePrincipal.MailboxInfo.OrganizationId); RecipientTypeDetails recipientTypeDetails = base.ExchangePrincipal.RecipientTypeDetails; this.featuresManagerFactory = new FeaturesManagerFactory(miniRecipient, new ConfigurationContext(this), new ScopeFlightsSettingsProvider(), (VariantConfigurationSnapshot c) => new FeaturesStateOverride(c, recipientTypeDetails), owaFlightConfigData.RampId, owaFlightConfigData.IsFirstRelease); } finally { if (aggregationContext != null) { aggregationContext.Detach(); this.bootAggregationContext = aggregationContext; } if (base.MailboxSessionLockedByCurrentThread()) { base.UnlockAndDisconnectMailboxSession(); } } }
private void ValidateAndDisposeAggregatedConfiguration(UserConfigurationManager.IAggregationContext aggregator, MailboxSession session) { bool flag = true; try { if (aggregator != null) { aggregator.Detach(); if (!base.CallContext.HasDeviceHeaders) { ValidateAggregatedConfiguration.AddToValidationCache(session, aggregator); flag = false; } else { flag = true; ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "user configuration being requested by an offline action."); object obj = ValidateAggregatedConfiguration.RemoveFromValidationCache(session); bool flag2 = obj is bool && (bool)obj; if (flag2) { ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "aggregated configuration was already validated during boot."); } else { DisposeGuard.DisposeIfPresent(obj as IDisposable); ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "aggregated configuration was not validated during boot. validating now."); aggregator.Validate(session, delegate(IEnumerable <UserConfigurationDescriptor.MementoClass> param0, IEnumerable <string> param1) { }); } ValidateAggregatedConfiguration.AddToValidationCache(session, true); } } } finally { if (flag) { DisposeGuard.DisposeIfPresent(aggregator); } } }