I ran into a seemingly simple problem the other day, but it took me several attempts with various libraries to find a solution, so I figured I’d share.
I had a need to print a single-page PDF file (in this case, a mailing label, but your case may vary) directly to a printer from C# without prompting a user. Continue reading
C# doesn’t allow for multiple inheritance, as Microsoft made a design decision when creating the .NET framework not to do so. Presumably, this is to avoid situations such as the diamond problem from occurring in the languages, among others.
However, what if we want to share methods or properties across classes that already have differing base classes?
I tend to vocalize (read: harp) on guard methods quite regularly, and given the debugging session I just completed, it is fresh on my mind.
So here goes: