Tag Archives: classes

Find class ancestors in C#

The example Find classes that implement an interface or that are descendants of a given class in C# shows how to find a list of classes that are descendants of a class or interface. This example uses similar code to … Continue reading

Posted in classes, inheritance, interfaces, reflection | Tagged , , , , , , , , , , , , , , , | Leave a comment

Find classes that implement an interface or that are descendants of a given class in C#

This example lets you find classes that are part of an inheritance or implementation hierarchy. When you enter a class or interface name and click Find, the example uses the following code to search the currently loaded assemblies for classes … Continue reading

Posted in classes, inheritance, interfaces, reflection | Tagged , , , , , , , , , , , , , , | 1 Comment

List a program’s loaded assemblies in C#

The key to this example is the following ListAssemblies method. // List the assemblies. private void ListAssemblies() { lblNumAssemblies.Text = “”; lstAssemblies.Items.Clear(); Cursor = Cursors.WaitCursor; Refresh(); foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { lstAssemblies.Items.Add(assembly.GetName().Name); } // Display the number of assemblies. … Continue reading

Posted in classes, reflection | Tagged , , , , , , , , , , , , | Leave a comment

Book Errata Page: The C# Helper Top 100

This is the errata page for my book The C# Helper Top 100, The 100 most popular posts at csharphelper.com. If you find mistakes, please post them here in the Leave a Reply box at the bottom of the page. … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Book Discussion Page: The C# Helper Top 100

This is a discussion page for my book The C# Helper Top 100, The 100 most popular posts at csharphelper.com. Please post questions, thoughts, and suggestions here in the “Leave a Reply” box at the bottom of the page. I … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Table of Contents: The C# Helper Top 100

This is a brief summary of the book’s table of contents. Introduction Part I. Serialization 1. Read a CSV File into an Array (1) 2. Use JSON to Serialize and Deserialize Objects (49) Part II. Graphing 3. Draw a Graph … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

New Book: The C# Helper Top 100

I’m happy to announce my latest book, The C# Helper Top 100, The 100 most popular posts at csharphelper.com. It describes the 100 most popular posts on the C# Helper web site. This is my 32nd book and my second … Continue reading

Posted in .NET, algorithms, books, C#, C# programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Use Array methods in C#

The example Sort and search arrays in C# shows how to use two useful Array methods: Sort and BinarySearch. This example demonstrates some other useful Array methods. For simplicity, this example uses arrays of characters to demonstrate the Array methods, … Continue reading

Posted in arrays, classes | Tagged , , , , , , , , , , , , , | Leave a comment

Create a class outside of any namespace statement in C#

When you create a class in C#, Visual Studio automatically puts it inside a namespace statement. If your project’s name is howto_remove_namespace, then by default that namespace is howto_remove_namespace. But did you know that you can create classes outside of … Continue reading

Posted in classes, syntax | Tagged , , , , , , , | 2 Comments

Make a simple event logger in C#

Usually the debugger lets you examine how a program works quite effectively, but sometimes it’s useful to use an event logger to record events for later study. For example, when you’re working with mouse events, stopping execution at a break … Continue reading

Posted in classes, debugging, files | Tagged , , , , , , , , , , | Leave a comment