In addition to classes, there are a number of C# types including structs and enums. In this course, you'll learn about creating types, including structs, enums and classes. You'll also learn about consuming types, including converting value and ref types. The course also explores encapsulation, implementing a class hierarchy, using reflection, and managing the object life cycle. Finally, you'll learn about manipulation of strings in C#.
Learning Objectives
Creating Types
- start the course
- create, modify, and compile structs using fields, properties, and methods
- create, modify, and debug enums
- create and use classes
- use constructors to instantiate classes
- use optional and named parameters
- use generic methods
Consuming Types
- convert value types
- convert ref types
- use the dynamic runtime
- use IConvertible
- use IFormattable
Enforcing Encapsulation
- format strings
- use auto-implemented properties
- implement explicit interfaces
Implementing a Class Hierarchy
- create interfaces
- implement inheritance
- create and implement indexers
- use IEnumerable
- use the Dispose method of the IDisposable interface to remove an object
- implement the IComparable interface
Find, Execute, and Create Types at Runtime
- use the System.Reflection namespace to provide a range of information about a type
- create attribute classes to add to a code construct
- use CodeDom to create code dynamically
Managing the Object Life Cycle
- guide the behavior of the .NET Framework's garbage collector
Manipulating Strings
- use the StringBuilder class to provide efficiencies when handling strings
- manipulate strings using StringReader and StringWriter
- use String methods
- search for characters in a string and use the String.Remove method
- format strings
- using the CultureInfo object to format dates and numbers defined by the string.Format method