Partager via


Members (C# Programming Guide) 

Classes and structs have members that represent their data and behavior. Those members include:

  • Fields (C# Programming Guide)
    Fields are instances of objects that are considered part of a class, normally holding class data. For example, a calendar class may have a field that contains the current date.
  • Properties (C# Programming Guide)
    Properties are methods on a class that are accessed as if they were fields on that class. A property can provide protection for a class field to keep it from being changed without the object's knowledge.
  • Methods (C# Programming Guide)
    Methods define the actions that a class can perform. Method can take parameters that provide input data, and can return output data through parameters. Methods can also return a value directly, without using a parameter.
  • Events (C# Programming Guide)
    Events are a way of providing notifications about occurrences, such as button clicks or the successful completion of a method, to other objects. Events are defined and triggered using delegates. For more information, see Events and Delegates.
  • Destructors (C# Programming Guide)
    Destructors are methods that are called by the runtime execution engine when the object is about to be removed from memory. They are generally used to make sure that any resources which need to be released are handled appropriately.
  • Nested Types (C# Programming Guide)
    Nested Types are types declared within a class or struct. Nested Types are often used to describe objects used only by the types containing them.

See Also

Reference

Methods (C# Programming Guide)
Methods (C# Programming Guide)
Destructors (C# Programming Guide)
Properties (C# Programming Guide)
Fields (C# Programming Guide)
Indexers (C# Programming Guide)
Nested Types (C# Programming Guide)
Operators (C# Programming Guide)
Overloadable Operators (C# Programming Guide)

Concepts

C# Programming Guide
Classes (C# Programming Guide)
Events (C# Programming Guide)
Events and Delegates

Other Resources

Constructors (C# Programming Guide)