L
Lucas Sain
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(field,BindingFlags.Instance |
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static |
BindingFlags.FlattenHierarchy);
if(parameterInfo == null)
{
if(Assembly.GetEntryAssembly() != 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(field,BindingFlags.Instance |
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static |
BindingFlags.FlattenHierarchy);
if(parameterInfo == null)
{
if(Assembly.GetEntryAssembly() != 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