Quantcast
Channel: 2,000 Things You Should Know About C# » Types
Browsing all 7 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

#30 – Types, Variables, Values, Instances

In C#, a type dictates what kind of values can be stored in a variable.  A variable is a storage location for some data.  Every variable is an instance of a specific type and will have a value that can...

View Article



Image may be NSFW.
Clik here to view.

#31 – Value Types and Reference Types

All types in C#, whether built-in or user-defined custom types, can be categorized as either value types or reference types. Value types Derive from System.ValueType (which derives from System.Object)...

View Article

Image may be NSFW.
Clik here to view.

#205 – Five Kinds of Types That Are User-Definable

C# allows you to create new types.  There are five kinds of types that you can define. A class is a data structure containing data and its associated behavior.  You can create an instance of a class...

View Article

Image may be NSFW.
Clik here to view.

#459 – Assigning a Value of a Different Type to an enum

You can convert to an enum value from its underlying type by casting the underlying type (e.g. int) to the enum type.  You can also assign a value of a different type, one that does not match the...

View Article

Image may be NSFW.
Clik here to view.

#699 – Types Are Implicitly Internal

When you define a type in C#, you can define its accessibility as either public or internal.  Public types are visible to all code.  Internal types are visible only to code within the same assembly. By...

View Article


Image may be NSFW.
Clik here to view.

#726 – Listing all Types within a Namespace

You can’t directly list out all types within a namespace.  But you can get all types within a particular assembly and then filter out only the types that match a particular namespace. static void...

View Article

Image may be NSFW.
Clik here to view.

#727 – Get a List of All Namespaces in an Assembly

While you can’t explicitly get a list of all namespaces within a .NET assembly, you can iterate through all types in the assembly and build up a list of namespaces. Below is some sample code that...

View Article
Browsing all 7 articles
Browse latest View live


Latest Images