.net - Late-binding static calls - C# 4.0 -
My goal is to be able to use intellisense, while still giving the compiler instructions to generate late binding code (I.e. CallSites and binders).
I have to say that
class MyDynamicDataProvider {public int data {get; Set}} I have to write:
MyDynamicDataProvider Provider = New MyDynamicDataProvider (); Int x = provider.Data; I want the data properties call to be delayed, but at present, if I do not declare the provider variable dynamic, call the compiler Will pre-bound. That is, in the runtime, the values stored in the backing field of the property will be returned. At the same time, I want intelllisense during coding, which means that I should use the appropriate type of provider.
Is there any way to get both ends together (depending on the dynamic bondage periodically, using steady declarations for intellisense)? Edit 1: Someone may be surprised that whatever logic I want is the fact that I am trying to develop some meta-class, which define the classrooms and the qualities of the developers. Will allow you to use gates, sets, methods etc. while being dynamic in a dynamic way. There are many types of such, and I would like to avoid such unnecessary codes in classes. Edit 2: It would be good if I can declare a class with one attribute that tells the compiler
It seems that you do not really want Dynamic , you just want to implement the functionality for statically defined properties and methods. If this is the case, then you can create classes as abstract and then apply them dynamically. There are several ways to do this, either directly using the reflection. Amit, or codedom, to generate the sections that are received from people who are summarized. Or you can use tools that make it very easy (and usually somewhat slow).
Comments
Post a Comment