O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting It Together: An Extensible Calculator

To recap everything you’ve learned about delegates so far, we create a calculator that can be extended by plugging in new operators. Although we don’t focus on the UI aspect, take a look at Figure 17.13 to see what I have in mind.

Image

FIGURE 17.13 An extensible calculator.

Besides typical arithmetic operations like add, subtract, multiply, divide, and modulo, four additional programmable function keys are provided. How this programming is done from a user’s point of view is something you can dream about, but what’s more interesting is how to create a generic calculator engine into which custom operations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required