public bool Unset(ushort tokenId) { //return Attributes.Remove(tokenId); int index = InnerKeys.IndexOf(tokenId); if (index >= 0) { InnerKeys.RemoveAt(index); InnerValues.RemoveAt(index); return(true); } return(false); }
bool ICollection <KeyValuePair <string, string> > .Contains(KeyValuePair <string, string> item) { //return ContainsKey(item.Key) //&& Attributes[DomData.TokenID(item.Key,true)] == item.Value; int index = InnerKeys.IndexOf(DomData.TokenID(item.Key, true)); if (index < 0) { return(false); } else { return(InnerValues[index] == item.Value); } }
public void SetBoolean(ushort tokenId) { //Attributes[tokenId] = null; int index = InnerKeys.IndexOf(tokenId); if (index < 0) { index = InnerKeys.Count; InnerKeys.Add(tokenId); InnerValues.Add(null); } else { InnerValues[index] = null; } }
protected string Get(ushort tokenId) { //string value; // if (Attributes.TryGetValue(tokenId, out value)) //if (Attributes.TryGetValue(tokenId, out value)) //{ // return value; //} //else //{ // return null; //} int index = InnerKeys.IndexOf(tokenId); return(index < 0 ? null : InnerValues[index]); }
/// <summary> /// Used by DomElement to (finally) set the ID value /// </summary> /// <param name="tokenId"></param> /// <param name="value"></param> internal void SetRaw(ushort tokenId, string value) { if (value == null) { Unset(tokenId); } else { //Attributes[tokenId] = value; int index = InnerKeys.IndexOf(tokenId); if (index < 0) { index = InnerKeys.Count; InnerKeys.Add(tokenId); InnerValues.Add(value); } else { InnerValues[index] = value; } } }
public bool ContainsKey(ushort tokenId) { //return Attributes.ContainsKey(tokenId); return(InnerKeys.Contains(tokenId)); }
public bool ContainsKey(string key) { //return Attributes.ContainsKey(DomData.TokenID(key, true)); return(InnerKeys.Contains(DomData.TokenID(key, true))); }
public void Clear() { //Attributes.Clear(); InnerKeys.Clear(); InnerValues.Clear(); }