Ejemplo n.º 1
0
        private void ReplaceCacheContent(object state)
        {
            var dps = PolicyManageService.GetAllDefaultPolicies().ToDictionary(p => p.Airline);
            var pss = PolicyManageService.GetAllPolicySettings().ToList();
            var phs = PolicyManageService.GetAllPolicyHarmonies().ToList();

            try {
                lock (defaultPolicies) {
                    defaultPolicies = dps;
                }
                lock (policySettings) {
                    policySettings = pss;
                }
                lock (policyHarmonies) {
                    policyHarmonies = phs;
                }
            }
            finally {
                lastUpdateTime = DateTime.Now;
                refreshing     = false;
            }
        }