Tag Archives: object-oriented programming

Override a parent class method in C#

One of the coolest features of object-oriented programming is virtual methods. If a parent class declares a method as virtual, a child class can provide a new implementation for the method. When the program calls the method for a child … Continue reading

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

Use the using statement to automatically call Dispose in C#

The using statement makes it easier to free resources when you’re finished with an object. Some objects take up important resources (such as brush handles or file handles) and only free them when they are destroyed. Because of the weird … Continue reading

Posted in OOP, syntax | Tagged , , , , , , , , , , , | Leave a comment

Use value equality to compare font objects in C#

This example explains the difference between reference equality and value equality, and shows how you can test value equality for font objects. Reference equality asks whether two variables refer to the same object. In contrast, value equality asks whether two … Continue reading

Posted in dialogs, fonts, OOP, syntax | Tagged , , , , , , , , , , , , , , | Leave a comment