internal bool IsLockdownAllowed()
        {
            if (TenantRelocationStateCache.IgnoreRelocationTimeConstraints())
            {
                return(true);
            }
            DateTime utcNow = DateTime.UtcNow;

            if (this.RelocationSyncStartTime != null && this.RelocationSyncStartTime.Value.ToUniversalTime() + TimeSpan.FromHours((double)TenantRelocationRequest.MinTimeBetweenRelocationStartAndLockdownHours) > utcNow)
            {
                return(false);
            }
            if (this.SafeLockdownSchedule == null || this.SafeLockdownSchedule == Schedule.Always)
            {
                return(true);
            }
            int  num = 0;
            uint num2;

            if (TenantRelocationSyncCoordinator.GetInt32ValueFromRegistryValue("TimeZoneOffset", out num2))
            {
                num = (int)num2;
            }
            return(this.SafeLockdownSchedule.Contains(utcNow.AddHours((double)num)));
        }
Example #2
0
        private bool TryReadRegistryHealthOverride(out ResourceLoadState healthValue)
        {
            uint num;
            bool int32ValueFromRegistryValue = TenantRelocationSyncCoordinator.GetInt32ValueFromRegistryValue("ADHealthOverrideForTenantRelocation", out num);

            if (int32ValueFromRegistryValue)
            {
                healthValue = (ResourceLoadState)num;
            }
            else
            {
                healthValue = ResourceLoadState.Unknown;
            }
            return(int32ValueFromRegistryValue);
        }