While writing a tool for automated solution deployment accross a DOTAP street (Development, Ontwikkeling, Test, Acceptatie, Productie), I had to loop over the solutions in the farm. If a job existed for a solution, I had to acquire more information about the job and especially what kind of solution jobtype it was (Deploy, Retract or Upgrade). In debug (Quickwatch), I found an instance of SPSolutionDeploymentJobDefinition, but I was unable to cast my SPJobDefintion to a SPSolutionDeploymentJobDefinition. After some research with .NET Reflector, my mystery was solved. It was an internal sealed class.
Internal means the member is accessible to other types that are defined in the same assembly. A Sealed class is sort of the oppositie of abstract. It can be instantiated but cannot serve as a base class. The primary reason to seal a class is to prevent your users from fiddling around with it and breaking it. It’s also the case that sealing a class permits certain compiler optimizations that are not possible with non-sealed classes. Obviously, a class cannot be both sealed and abstract.
So conclusion, no cast and I had to find another way to do my thing.
