public bool HasStateChanged(DependencyState establishedState) { // Delegate down to all managers, returning the first non-null result return(Managers .Select(manager => manager.HasStateChanged(establishedState)) .Where(stateChanged => stateChanged != null) .FirstOrDefault() ?? true); }
public bool?HasStateChanged(DependencyState establishedState) { if (!(establishedState.Context is QueryDependencyStateContext)) { return(null); } var currentState = GetState((QueryDependencyStateContext)establishedState.Context); var stateChanged = currentState.State != establishedState.State; if (stateChanged && AppConfigProvider.GetAppConfigValue <bool>("ObjectCacheDebuggingEnabled")) { Debug.WriteLine(string.Format( "ObjCache - Query Changed - {0}", ((QueryDependencyStateContext)establishedState.Context).Query)); } return(stateChanged); }
public bool?HasStateChanged(DependencyState establishedState) { if (!(establishedState.Context is CheckoutShippingSelectionDependencyStateContext)) { return(null); } var currentState = GetState(establishedState.Context); var stateChanged = currentState.State != establishedState.State; if (stateChanged && AppConfigProvider.GetAppConfigValue <bool>("ObjectCacheDebuggingEnabled")) { Debug.WriteLine(string.Format( "ObjCache - Checkout Shipping Selection Changed - Customer {0}", ((CheckoutShippingSelectionDependencyStateContext)establishedState.Context).CustomerId)); } return(stateChanged); }