private static bool ShouldCreateSharedConfiguration(string programId, string offerId, PartitionId partitionId, out ExchangeConfigurationUnit sctConfigUnit) { sctConfigUnit = null; ADDriverContext processADContext = ADSessionSettings.GetProcessADContext(); if (processADContext == null || processADContext.Mode != ContextMode.Setup) { return(true); } SharedConfigurationInfo sci = SharedConfigurationInfo.FromInstalledVersion(programId, offerId); sctConfigUnit = SharedConfiguration.FindOneSharedConfiguration(sci, partitionId); return(sctConfigUnit == null); }
// Token: 0x060008E1 RID: 2273 RVA: 0x00027BE0 File Offset: 0x00025DE0 private CacheMode GetCacheMode() { bool flag = false; ADDriverContext addriverContext = ADSessionSettings.GetProcessADContext() ?? ADSessionSettings.GetThreadADContext(); if (addriverContext != null) { if (ContextMode.Setup == addriverContext.Mode || ContextMode.TopologyService == addriverContext.Mode) { return(CacheMode.Disabled); } flag = (ContextMode.Cmdlet == addriverContext.Mode); } if (!flag) { return(CacheMode.Read | CacheMode.SyncWrite); } return(CacheMode.AsyncWrite); }
private static bool ShouldCreateTenantTemplate(string programId, string offerId, PartitionId partitionId, out ExchangeConfigurationUnit sctConfigUnit) { sctConfigUnit = null; ADDriverContext processADContext = ADSessionSettings.GetProcessADContext(); if (processADContext == null || processADContext.Mode != ContextMode.Setup) { return(true); } ADPagedReader <ExchangeConfigurationUnit> adpagedReader = TemplateTenantConfiguration.FindAllTempateTenants(programId, offerId, partitionId); foreach (ExchangeConfigurationUnit exchangeConfigurationUnit in adpagedReader) { if (exchangeConfigurationUnit.SharedConfigurationInfo != null && ((IComparable)TemplateTenantConfiguration.RequiredTemplateTenantVersion).CompareTo(exchangeConfigurationUnit.SharedConfigurationInfo.CurrentVersion) <= 0) { sctConfigUnit = exchangeConfigurationUnit; return(false); } } return(true); }