Example #1
0
    public static T CreateBaseClass <T>() where T : BaseClass, new()
    {
        // Create and return a BaseClass.
        // Everything in BaseClass should be accessible here.

        //example
        BaseClassFunctionHolder holder = new BaseClassFunctionHolder();
        T baseClass = _createBaseClass(holder);

        //access to baseClass methods through holder.DoStuff, and holder.DoOtherStuff
        return(baseClass);
    }
Example #2
0
 private BaseClass(BaseClassFunctionHolder holder)
 {
     holder.DoStuff      = DoStuff;
     holder.DoOtherStuff = DoOtherStuff;
 }