Ejemplo n.º 1
0
        /// <summary>
        /// Load the Map Files
        /// </summary>
        public void LoadOverrideMaps()
        {
            defaultmap = new Hashtable();
            modelmap   = new Hashtable();

            defaultmap[true]  = new CacheItems();
            defaultmap[false] = new CacheItems();
            foreach (CacheContainer cc in Containers)
            {
                if (cc.Type == ContainerType.MaterialOverride && cc.Valid)
                {
                    foreach (MMATCacheItem mci in cc.Items)
                    {
                        CacheItems l = (CacheItems)defaultmap[mci.Default];
                        l.Add(mci);

                        l = (CacheItems)modelmap[mci.ModelName];
                        if (l == null)
                        {
                            l = new CacheItems();
                            modelmap[mci.ModelName] = l;
                        }
                        l.Add(mci);
                    }
                }
            }            //foreach
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new Instance
        /// </summary>
        public CacheContainer(ContainerType type)
        {
            version   = VERSION;
            this.type = type;
            added     = DateTime.Now;
            filename  = "";
            valid     = ContainerValid.Yes;

            items = new CacheItems();
        }
Ejemplo n.º 3
0
        public override object Clone()
        {
            CacheItems list = new CacheItems();

            foreach (ICacheItem item in this)
            {
                list.Add(item);
            }

            return(list);
        }
Ejemplo n.º 4
0
        public virtual void Dispose()
        {
            if (items != null)
            {
                foreach (object o in items)
                {
                    if (o is IDisposable)
                    {
                        ((IDisposable)o).Dispose();
                    }
                }

                items.Clear();
            }
            items = null;
        }