Lecture overview -- Keyboard shortcut: 'u'  Previous page: Examples of Interfaces -- Keyboard shortcut: 'p'  Next page: Sample use of IComparable -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 14 : 37
Object-oriented Programming in C#
Abstract classes, Interfaces, and Patterns
Interfaces from the C# Libraries

The C# library contains a number of important interfaces which are used frequently in many C# programs

  • IComparable

    • An interface that prescribes a CompareTo method

    • Used to support general sorting and searching methods

  • IEnumerable

    • An interface that prescribes a method for accessing an enumerator

  • IEnumerator

    • An interface that prescribes methods for traversal of data collections

    • Supports the underlying machinery of the foreach control structure

  • IDisposable

    • An interface that prescribes a Dispose method

    • Used for deletion of resources that cannot be deleted by the garbage collector

    • Supports the C# using control structure

  • ICloneable

    • An interface that prescribes a Clone method

  • IFormattable

    • An interface that prescribes an extended ToString method