Parent Directory
|
Revision Log
|
Patch
--- trunk/libxmltv/Core/PropertyDictionary.cs 2013/03/10 10:13:16 98 +++ trunk/libxmltv/Core/PropertyDictionary.cs 2013/03/10 11:35:26 105 @@ -141,24 +141,24 @@ return collection.IsReadOnly; } } - public void AddProperty(PropertyValuePair<TKey, TValue> item) { AddProperty(item.Name, item.Value); } + public void AddProperty(IPropertyValuePair<TKey, TValue> item) { AddProperty(item.Name, item.Value); } public void ClearProperties() { properties.Clear(); } - public bool ContainsProperty(PropertyValuePair<TKey, TValue> item) { return ContainsProperty(item.Name); } - public void CopyPropertiesTo(PropertyValuePair<TKey, TValue>[] array, int arrayIndex) + public bool ContainsProperty(IPropertyValuePair<TKey, TValue> item) { return ContainsProperty(item.Name); } + public void CopyPropertiesTo(IPropertyValuePair<TKey, TValue>[] array, int arrayIndex) { - var list = properties.ToList().Cast<PropertyValuePair<TKey, TValue>>().ToList(); + var list = properties.ToList().Cast<IPropertyValuePair<TKey, TValue>>().ToList(); list.CopyTo(array, arrayIndex); } - public bool RemoveProperty(PropertyValuePair<TKey, TValue> item) { return RemoveProperty(item.Name); } - IEnumerator<PropertyValuePair<TKey, TValue>> IEnumerable<PropertyValuePair<TKey, TValue>>.GetEnumerator() { return new PropertyDictionaryEnumerator(this, 2); } + public bool RemoveProperty(IPropertyValuePair<TKey, TValue> item) { return RemoveProperty(item.Name); } + IEnumerator<IPropertyValuePair<TKey, TValue>> IEnumerable<IPropertyValuePair<TKey, TValue>>.GetEnumerator() { return new PropertyDictionaryEnumerator(this, 2); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return properties.GetEnumerator(); } #region enumerator support - public class PropertyDictionaryEnumerator: IEnumerator<PropertyValuePair<TKey,TValue>>, IDisposable + public class PropertyDictionaryEnumerator : IEnumerator<IPropertyValuePair<TKey, TValue>>, IDisposable { private PropertyDictionary<TKey, TValue> dictionary; private int index; - private PropertyValuePair<TKey, TValue> current; + private IPropertyValuePair<TKey, TValue> current; private int getEnumeratorRetType; internal const int DictEntry = 1; internal const int KeyValuePair = 2; @@ -172,7 +172,7 @@ this.current = new PropertyValuePair<TKey, TValue>(); } - public PropertyValuePair<TKey, TValue> Current + public IPropertyValuePair<TKey, TValue> Current { get { return this.current; } } @@ -207,7 +207,7 @@ { if (this.dictionary.entries[this.index].hashCode >= 0) { - this.current = new KeyValuePair<TKey, TValue>(this.dictionary.entries[this.index].name, this.dictionary.entries[this.index].value); + this.current =(IPropertyValuePair<TKey,TValue>)(PropertyValuePair<TKey,TValue>)new KeyValuePair<TKey, TValue>(this.dictionary.entries[this.index].name, this.dictionary.entries[this.index].value); this.index++; return true; } @@ -224,7 +224,7 @@ ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_EnumFailedVersion); } this.index = 0; - this.current = new KeyValuePair<TKey, TValue>(); + this.current = (IPropertyValuePair<TKey, TValue>)(PropertyValuePair<TKey, TValue>)new KeyValuePair<TKey, TValue>(); } } #endregion
ViewVC Help | |
Powered by ViewVC 1.1.22 |