internal static bool IsServiceInstanceEmpty(SyncServiceInstance syncServiceInstance)
        {
            TaskLogger.LogEnter();
            CookieManager cookieManager = CookieManagerFactory.Default.GetCookieManager(ForwardSyncCookieType.RecipientIncremental, syncServiceInstance.Name, 1, TimeSpan.FromMinutes(30.0));

            byte[] array = cookieManager.ReadCookie();
            if (array != null && array.Length > 0)
            {
                return(false);
            }
            CookieManager cookieManager2 = CookieManagerFactory.Default.GetCookieManager(ForwardSyncCookieType.CompanyIncremental, syncServiceInstance.Name, 1, TimeSpan.FromMinutes(30.0));

            array = cookieManager2.ReadCookie();
            if (array != null && array.Length > 0)
            {
                return(false);
            }
            ForwardSyncDataAccessHelper       forwardSyncDataAccessHelper = new ForwardSyncDataAccessHelper(syncServiceInstance.Name);
            IEnumerable <FailedMSOSyncObject> source = forwardSyncDataAccessHelper.FindDivergence(null);

            if (source.Any <FailedMSOSyncObject>())
            {
                return(false);
            }
            TaskLogger.LogExit();
            return(true);
        }
        private void MarkDivergencesHalting(QueryFilter filter)
        {
            ForwardSyncDataAccessHelper       forwardSyncDataAccessHelper = new ForwardSyncDataAccessHelper(base.DataObject.ServiceInstanceId);
            IEnumerable <FailedMSOSyncObject> enumerable           = forwardSyncDataAccessHelper.FindDivergence(filter);
            IConfigurationSession             configurationSession = ForwardSyncDataAccessHelper.CreateSession(false);

            foreach (FailedMSOSyncObject failedMSOSyncObject in enumerable)
            {
                failedMSOSyncObject.IsIgnoredInHaltCondition = false;
                configurationSession.Save(failedMSOSyncObject);
            }
        }