Tag Archives: generic

Make generic Min and Max methods in C#

This example shows how you can make generic Min and Max methods to find the minimum and maximum values in a sequence of parameters. The Math namespace’s Min and Max methods are very useful, but they have two big drawbacks. … Continue reading

Posted in algorithms, arrays, calculations, generic, methods | Tagged , , , , , , , , , , , , , , | Leave a comment

Draw a family tree in C#

This example shows how to use the generic TreeNode class to draw a family tree. The example Draw a tree with nodes containing pictures in C# draws a picture showing part of the British royal family tree. It works, but … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , , , , , , , | 18 Comments

Draw a tree with nodes containing pictures in C#

This example uses the generic TreeNode class described in the following posts to draw a tree with nodes containing pictures. Make a generic TreeNode class in C#, Part 1 Make a generic TreeNode class in C#, Part 2 The program … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , , , , , , | 1 Comment

Handle generic TreeNode mouse events in C#

This example shows how you can make a generic TreeNode class handle MouseMove and MouseDown events. It adds those events to the example described in the following posts: Make a generic TreeNode class in C#, Part 1 Make a generic … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , | 11 Comments

Make a generic TreeNode class in C#, Part 2

This post explains how the TreeNode class uses its generic TreeNode class to arrange and draw a tree. For information about that classes used by this example and how to define the generic TreeNode class it uses, see Make a … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , | 4 Comments

Make a generic TreeNode class in C#, Part 1

This example shows how to build a generic TreeNode class that can draw a tree holding just about anything. This is kind of a tricky example, so I’m doing it in two parts. This entry explains the classes and interfaces … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , , | 21 Comments

Make a generic priority queue class in C#

This example shows how to make a generic priority queue class. A generic class is similar to a regular class except it can take one or more parameters that are types. The class can then use the type to define … Continue reading

Posted in classes, generic, OOP | Tagged , , , , , , , , , | 3 Comments