MSDN Documentation

Interfaces

Interfaces define a contract that classes can implement. They specify a set of members (methods, properties, events) that a class must provide. Interfaces are a core concept in object-oriented programming for achieving polymorphism and abstraction.

IEnumerable<T>

Represents the strongly typed collection of objects that can have its individual elements iterated over.

Methods

  • IEnumerator<T> GetEnumerator()

ICollection<T>

Represents a strongly typed collection of objects that can be accessed by index. Implements IEnumerable<T>.

Properties

  • int Count { get; }
  • bool IsReadOnly { get; }

Methods

  • void Add(T item)
  • void Clear()
  • bool Contains(T item)
  • void CopyTo(T[] array, int arrayIndex)
  • bool Remove(T item)

IDictionary<TKey, TValue>

Represents a collection of key/value pairs.

Properties

  • ICollection<TKey> Keys { get; }
  • ICollection<TValue> Values { get; }
  • TValue this[TKey key] { get; set; }

Methods

  • void Add(TKey key, TValue value)
  • bool ContainsKey(TKey key)
  • bool Remove(TKey key)
  • bool TryGetValue(TKey key, out TValue value)

IDisposable

Provides a mechanism for releasing unmanaged resources.

Methods

  • void Dispose()

ICloneable

Supports cloning, which creates a copy of the current instance.

Methods

  • object Clone()