public static CachedOrganizationConfiguration GetInstance(OrganizationId organizationId, TimeSpan timeoutInterval, CachedOrganizationConfiguration.ConfigurationTypes configurationTypes = CachedOrganizationConfiguration.ConfigurationTypes.All)
        {
            CachedOrganizationConfiguration cachedOrganizationConfiguration;

            if (organizationId == OrganizationId.ForestWideOrgId && !VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled)
            {
                if (CachedOrganizationConfiguration.corporateInstance == null)
                {
                    lock (CachedOrganizationConfiguration.corporateInstanceLock)
                    {
                        if (CachedOrganizationConfiguration.corporateInstance == null)
                        {
                            cachedOrganizationConfiguration = new CachedOrganizationConfiguration(organizationId, timeoutInterval, CachedOrganizationConfiguration.ConfigurationTypes.All);
                            cachedOrganizationConfiguration.Initialize();
                            CachedOrganizationConfiguration.corporateInstance = cachedOrganizationConfiguration;
                        }
                    }
                }
                cachedOrganizationConfiguration = CachedOrganizationConfiguration.corporateInstance;
            }
            else
            {
                cachedOrganizationConfiguration = new CachedOrganizationConfiguration(organizationId, timeoutInterval, configurationTypes);
            }
            cachedOrganizationConfiguration.Initialize();
            return(cachedOrganizationConfiguration);
        }
        public void Initialize(CachedOrganizationConfiguration configuration, ADRawEntry sender)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }
            if (sender == null)
            {
                throw new ArgumentNullException("sender");
            }
            MailTipsConfiguration.GetMailTipsConfigurationTracer.TraceFunction <CachedOrganizationConfiguration, string>((long)this.traceId, "Entering MailTipsConfiguration.Initialize({0}, {1})", configuration, sender.Id.ToString());
            this.DetermineMaxMessageSize(configuration.TransportSettings.Configuration, sender);
            Organization configuration2 = configuration.OrganizationConfiguration.Configuration;

            this.showExternalRecipientCount = configuration2.MailTipsExternalRecipientsTipsEnabled;
            this.largeAudienceThreshold     = (int)configuration2.MailTipsLargeAudienceThreshold;
            this.policyTipsEnabled          = (from rule in configuration.PolicyNudgeRules.Rules
                                               where rule.IsEnabled
                                               select rule).Any <PolicyNudgeRule>();
        }
 public static CachedOrganizationConfiguration GetInstance(OrganizationId organizationId, CachedOrganizationConfiguration.ConfigurationTypes configurationTypes = CachedOrganizationConfiguration.ConfigurationTypes.All)
 {
     return(CachedOrganizationConfiguration.GetInstance(organizationId, TimeSpan.Zero, configurationTypes));
 }