/// <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)); }
/// <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; }
/// <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); }
/// <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)); }
public bool Contains(GroupCacheItem item) { return(base.Contains(item)); }
public void Remove(GroupCacheItem item) { base.Remove(item); }
public void Insert(int index, GroupCacheItem item) { base.Insert(index, item); }
public int Add(GroupCacheItem item) { return(base.Add(item)); }