1 namespace System.Activities.Presentation.PropertyEditing
4 using System.Collections.Generic;
6 using System.Activities.Presentation;
7 using System.Collections;
10 /// Collection class that is used to keep the collection of PropertyEntry instances for
11 /// subproperties of a given PropertyEntry
13 public abstract class PropertyEntryCollection : IEnumerable<PropertyEntry>
16 private PropertyValue _parentValue;
19 /// Creates a PropertyEntryCollection. For host implementations.
21 /// <param name="parentValue">The parent PropertyValue</param>
22 /// <exception cref="ArgumentNullException">When parentValue is null</exception>
23 protected PropertyEntryCollection(PropertyValue parentValue)
25 if (parentValue == null)
26 throw FxTrace.Exception.ArgumentNull("parentValue");
28 _parentValue = parentValue;
32 /// Gets the parent PropertyValue
34 public PropertyValue ParentValue { get { return _parentValue; } }
37 /// Gets a PropertyEntry from this collection of the given name. Used for
38 /// sub-property retrieval.
40 /// <param name="propertyName">The name of the property</param>
41 /// <returns>PropertyEntry instance of the given name or null if it doesn't exist.</returns>
42 public abstract PropertyEntry this[string propertyName] { get; }
45 /// Gets the number of PropertyEntry instances in this collection
46 /// (typically the number of sub-properties for the parent PropertyValue)
48 public abstract int Count { get; }
51 /// Returns an IEnumerator of all the PropertyEntry instances in this collection.
53 /// <returns></returns>
54 public abstract IEnumerator<PropertyEntry> GetEnumerator();
56 IEnumerator IEnumerable.GetEnumerator()
58 return this.GetEnumerator();