Esempio n. 1
0
        public IList <SprocketComboInfo> CalculateSprocketComboInfo(IActivity activity)
        {
            if (activity != null)
            {
                bool retrieveInfo = true;
                SprocketComboInfoCacheItem cachedItem = null;

                if (m_InfoCache.ContainsKey(activity) && !m_InfoCache[activity].m_Dirty)
                {
                    retrieveInfo = false;
                }

                if (retrieveInfo)
                {
                    ITimeDataSeries <SprocketCombo> sprocketTrack = ActivityGearTrackCache.Instance.CalculateSprocketTrack(activity);
                    IList <SprocketComboInfo>       sprocketInfo  = Common.Data.Calculate(activity, sprocketTrack);

                    UpdateCachedInfo(activity, sprocketInfo);
                }

                cachedItem = m_InfoCache[activity];

                return(cachedItem.m_ComboInfo);
            }

            return(null);
        }
Esempio n. 2
0
        private void UpdateCachedInfo(IActivity activity, IList <SprocketComboInfo> sprocketInfo)
        {
            SprocketComboInfoCacheItem newCacheItem = new SprocketComboInfoCacheItem(activity, sprocketInfo);

            if (!m_InfoCache.ContainsKey(activity))
            {
                m_InfoCache.Add(activity, null);

                activity.PropertyChanged += new PropertyChangedEventHandler(OnActivityDataChanged);
            }

            m_InfoCache[activity] = newCacheItem;
        }