示例#1
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        protected override void Unserialize(System.IO.BinaryReader reader)
        {
            maxgroup = 0x6f000000;
            items.Clear();
            map.Clear();
            //return;
            id = reader.ReadUInt32();
            uint ct = reader.ReadUInt32();

            for (int i = 0; i < ct; i++)
            {
                try
                {
                    GroupCacheItem gci = new GroupCacheItem();
                    gci.Unserialize(reader);
                    Add(gci);
                }
#if DEBUG
                catch (Exception ex)
                {
                    Helper.ExceptionMessage("", ex);
                }
#else
                catch (Exception)
                {
                }
#endif
            }

            over = reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position));
        }
示例#2
0
 /// <summary>
 /// Add a new Item
 /// </summary>
 /// <param name="gci">The Item to Add</param>
 public void Add(GroupCacheItem gci)
 {
     if (gci.LocalGroup > maxgroup)
     {
         maxgroup = gci.LocalGroup;
     }
     items.Add(gci);
     map[AbsoluteFileName(gci.FileName)] = gci;
 }
示例#3
0
        /// <summary>
        /// Return an apropriate Item for the passed File
        /// </summary>
        /// <param name="flname"></param>
        /// <returns></returns>
        public IGroupCacheItem GetItem(string flname)
        {
            GroupCacheItem gci = (GroupCacheItem)map[flname.Trim().ToLower()];

            if (gci == null)
            {
                gci            = new GroupCacheItem();
                gci.FileName   = flname;
                gci.LocalGroup = maxgroup + 1;
                Add(gci);
            }

            return(gci);
        }
示例#4
0
 /// <summary>
 /// Remove a Item
 /// </summary>
 /// <param name="gci">The Item you want to remove</param>
 public void Remove(GroupCacheItem gci)
 {
     items.Remove(gci);
     map.Remove(AbsoluteFileName(gci.FileName));
 }
示例#5
0
 public bool Contains(GroupCacheItem item)
 {
     return(base.Contains(item));
 }
示例#6
0
 public void Remove(GroupCacheItem item)
 {
     base.Remove(item);
 }
示例#7
0
 public void Insert(int index, GroupCacheItem item)
 {
     base.Insert(index, item);
 }
示例#8
0
 public int Add(GroupCacheItem item)
 {
     return(base.Add(item));
 }