Contents tagged with c#
-
Value types can have methods!
void Main() { var one = new ValueType(); var two = one; // two's value is now a copy of one's value // and both are **actual values** var three = new ReferenceType(); var … more
-
Memory Leak
Short Definition: A memory leak occurs when an object is taking up RAM even though the application will never again use the object.
Memory leaks can be either recoverable or unrecoverable. Recoverable leaks occur when we have an object reference and can thereby dispose of the object; unrecoverable ones occur when we don't. more
-
Stack
Short Definition: The stack is where functions store their value type data.
See Also:
Each thread receives its own stack. A stack contains discrete blocks of RAM memory. The runtime allocates blocks to functions in first-in-first-out order. On invocation, a function receives a block … more
-
;Heap
Short Definition: The heap is where objects store their value type data.
See Also:
Each application (aka process) receives its own heap A heap contains discrete blocks of RAM. The runtime allocates blocks to objects in an unenforced pattern. On creation, an object receives memory … more
-
Type Systems
A type system's main purpose is to reduce software bugs. Types are assigned to each data value. Rules define what operations each data type supports. Checking determines whether our code follows … more
-
C# Delegate Notes
C# Version 1 Declaring a delegate is similar to defining a class, struct, or interface. That is, we can define it inside or outside a class. A delegate type specifies the parameter and return types … more
-
Inheritance, Interfaces, and the Abstract, Virtual, and Sealed Keywords in C#
Introduction This is meant to be an incomplete overview of inheritance related keywords in C#. There are more details in the MSDN documentation. abstract: https://msdn.microsoft.com/en-us/library/sf9 … more
-
Quick Watch on an Orchard.ContentManagement.ContentItem
This is what you’ll see in the top level of the Watch window. I find the yellow ones useful. NewsItem base Duplicates MyContentItem. _parts Duplicate Parts. ContentManager ContentType A string that … more
-
Action, Func, Predicate (and other C# System-Level Delegates)
C# Delegate Types C# has several System-level delegate types. Here are the most popular: Action AsyncCallback Comparison Converter EventHandler Func Takes zero to 16 parameters. Returns a … more