Recent content by matthew.abercrombie

  1. M

    Question Enforce "contract" without using an Interface

    Thanks, that indeed will work to solve the problem I presented. However, I am actually looking for a way to force the developer who is implementing MyAbstractClass to implement Bar(). While shadowing the Shared method gives the developer the opportunity to implement Bar(), it will not force...
  2. M

    Question Enforce "contract" without using an Interface

    I have a situation where I need to make sure that a class implements a set of Shared methods. The context is quite complex, so I'll spare the details. I basically have an abstract class that deals heavily with Generics. I need to call a Shared method on the Generic class T. I need to make sure...
  3. M

    Question Create Property Setter Delegate via DynamicMethod

    Thanks, John. Your answer sheds light on the problem. Before reading your post, I found System.Enum.ToObject does the conversion I need. However, it caused me to introduce an IF check within the loop, which is not desirable. The smallint datatype from the database is more accurate than the...
  4. M

    Question Create Property Setter Delegate via DynamicMethod

    Fixed it, but new problem now... I found the offending line: ILGen.EmitCall(OpCodes.Callvirt, setter, Nothing) It should have been: ILGen.EmitCall(OpCodes.Callvirt, setMethod, Nothing) My new problem is that as it is setting the value of a property that return an enum, I am getting a...
  5. M

    Question Create Property Setter Delegate via DynamicMethod

    I'm building an abstract class that handles some common operations for all of my data access objects. The class will utilize generics, so I can't make direct calls to constructors, business object properties, etc. Reflection is way too slow for what I want to accomplish, so I am using a...
Top Bottom