Hi,
I have a form (A) which has a collection as a property. All my forms
inhert from this base form.
I'm tring to put some code in form A where I can get the fieldInfo from
the form that imnherits from A. This is the code:
Type t = this.GetType();
FieldInfo parameterInfo = t.GetField(fiel d,BindingFlags. Instance |
BindingFlags.No nPublic | BindingFlags.Pu blic | BindingFlags.St atic |
BindingFlags.Fl attenHierarchy) ;
if(parameterInf o == null)
{
if(Assembly.Get EntryAssembly() != null )
{
MessageBox.Show ("Field nod found");
fieldFound = false;
}
}
The problem with this is that it gets the Assembly from Form A (base form)
because its where the collection was called so then the field is never
found. Form A (bas form) is in another assembly/solution. All this has to be
done is design time and not runtime. How can I get the fileds or assembly of
the current form and not the inhertided form.
I hope I made my self clear..
Regards
Lucas
I have a form (A) which has a collection as a property. All my forms
inhert from this base form.
I'm tring to put some code in form A where I can get the fieldInfo from
the form that imnherits from A. This is the code:
Type t = this.GetType();
FieldInfo parameterInfo = t.GetField(fiel d,BindingFlags. Instance |
BindingFlags.No nPublic | BindingFlags.Pu blic | BindingFlags.St atic |
BindingFlags.Fl attenHierarchy) ;
if(parameterInf o == null)
{
if(Assembly.Get EntryAssembly() != null )
{
MessageBox.Show ("Field nod found");
fieldFound = false;
}
}
The problem with this is that it gets the Assembly from Form A (base form)
because its where the collection was called so then the field is never
found. Form A (bas form) is in another assembly/solution. All this has to be
done is design time and not runtime. How can I get the fileds or assembly of
the current form and not the inhertided form.
I hope I made my self clear..
Regards
Lucas
Comment