public void RemoveKey(IDictionaryKey key) { if (innerDictionary.ContainsKey(key)) { SLOT slot = innerDictionary[key]; innerDictionary.Remove(key); ILinkSlot ls = slot as ILinkSlot; if (ls != null) { ls.isDeleted = true; if (ls.preSlot != null) { ls.preSlot.nextSlot = ls.nextSlot; if (ls.nextSlot != null) { ls.nextSlot.preSlot = ls.preSlot; } ls.preSlot = null; } else { if (ls.nextSlot != null) { ls.nextSlot.preSlot = null; } } } } }
//public void createOrReplaceproperty(string name, ILinkSlot slot) //{ // if (!propertys.ContainsKey(name)) // { // propertys.Add(name, slot); // if (rootSlot == null) // { // rootSlot = slot; // } // else // { // rootSlot.preSlot = slot; // slot.nextSlot = rootSlot; // rootSlot = slot; // } // } // else // { // ISLOT oldslot = propertys[name]; // propertys[name] = slot; // } //} public void deleteProperty(string name) { if (propertys.ContainsKey(name)) { SLOT slot = propertys[name]; propertys.Remove(name); ILinkSlot ls = slot as ILinkSlot; if (ls != null) { ls.isDeleted = true; if (ls.preSlot != null) { ls.preSlot.nextSlot = ls.nextSlot; if (ls.nextSlot != null) { ls.nextSlot.preSlot = ls.preSlot; } ls.preSlot = null; } else { if (ls.nextSlot != null) { ls.nextSlot.preSlot = null; } } } } }
public void createKeyValue(IDictionaryKey key,ILinkSlot value) { if (!isContainsKey(key)) { innerDictionary.Add(key,(SLOT)value); if (rootSlot == null) { rootSlot = value; } else { rootSlot.preSlot = value; value.nextSlot = rootSlot; rootSlot = value; } } }
public void createproperty(string name,ILinkSlot slot) { if (!propertys.ContainsKey(name)) { propertys.Add(name,(SLOT)slot); if (rootSlot == null) { rootSlot = slot; } else { rootSlot.preSlot = slot; slot.nextSlot = rootSlot; rootSlot = slot; } } }