Esempio n. 1
0
        public void ApplyCachingPolocy(NodeAction n, bool combine = false, bool eraseCache = true)
        {
            if (n == null)
            {
                throw new ArgumentNullException("n");
            }

            IDisposedExtensions.CheckDisposed(this as IDisposed);

            if (combine)
            {
                m_NodeCachingPolicy += n;
            }
            else
            {
                m_NodeCachingPolicy = n;
            }

            if (eraseCache)
            {
                if (m_NodeCache != null)
                {
                    m_NodeCache.Clear();
                }
                else if (n != null && m_NodeCache == null)
                {
                    m_NodeCache = new SortedDictionary <long, Node>();
                }
                else if (n == null && m_NodeCache != null)
                {
                    m_NodeCache.Clear();

                    m_NodeCache = null;
                }
            }
        }