コード例 #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));
 }