Skip to content

Consider removing DirectiveCollection #1912

Closed
@jonsequitur

Description

@jonsequitur

It can likely be replaced with a dictionary, or directives can become symbols and use the same lookup mechanisms are other symbol types use.

    // From guideline prose:
    // "When implementing such a custom collection, follow the API pattern
    // established by Collection<T> and ReadOnlyCollection<T> as
    // closely as possible. That is, implement the same members explicitly,
    // name the parameters in the same way that these two collections name
    // them, and so on. In other words, make your custom collection different
    // from these two collections only when you have a very good reason to
    // do so."
    public class DirectiveCollection : IEnumerable<KeyValuePair<string,IEnumerable<string>>>, IEnumerable 
    {
        public DirectiveCollection();
        public bool Contains(string name);
        public IEnumerator<KeyValuePair<string,IEnumerable<string>>> GetEnumerator();
        public bool TryGetValues(string name, ref IReadOnlyList<string> values);
    }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions