private field is never 'assigned' ; force comiler to stop complaining?
Hello,
Not sure if this is exactly the right place to post this, so let me
know if there is a more relevant group.
I have a series of private members in my class, none of which are
'assigned to' as far as the compiler can tell. They *are* set, just by
reflection in a base class. Each member is tagged with an attribute
that tells the binder to do this, so I was hoping to use this as a
basis for supressing or eliminating the compiler warning.
I know that the ASP.Net controls, when you put them in something that
derives from Page, do not complain about this. Perhaps this is a
starting point?
The code currently looks like this :
[BindForMe] protected Textbox txtBox = null;
The null is required, or the error shows up.
Not even sure exactly what question to ask, so any help would be much
appreciated.
Thanks,
Andrew Backer
.
Relevant Pages
- Re: Having problem getting private members using reflection.
... Private members from the concrete class or the base class? ... there's one last bit of detail where private base class members are inaccessible via reflection on the derived type. ... I did some digging and the MSDN documentation states that the caller must have ReflectionPermission in order to get the private members of a class. ... Could someone please clarify on what I need to do in order for my code to be able to parse private members of my Page using reflection? ... (microsoft.public.dotnet.framework.aspnet) - Re: private instance variable of derived class not always returned by base class getter?
... combination of private instance variables than can be accessed through ... getters declared in the base class. ... Private members can only be seen inside the ... The getters and setters of the base-class can only ... (comp.lang.java.help) - Re: OO Design question
... Today your base class *only* has common data. ... Pure data-only objects are well-expressed using structs. ... instantiating your structs as private members of the base class, ... also happens to be far more flexible than using multiple levels of ... (microsoft.public.dotnet.languages.csharp) - RE: When should we use the single inheritance v.s private members
... In case of single inheritance u can call functions of base class ... I am sending u the code so u can understand the logic when use single inheritance or when use private members as containers.. ... int main(int argc, char* argv[]) ... (microsoft.public.dotnet.languages.vc) |
|