D
Dan Holmes
If i have Class2 that is inherited by Class1, how can Class1's methods
operate on Class2's assembly information?
For instance:
public class Component
{
public virtual List<ComponentInfo> GetAssemblyInfo()
{
try
{
List<ComponentInfo> ci = new List<ComponentInfo>();
// how can Component get the assembly of its immediate descendant?
ci.Add(fillComponentInfo(System.Reflection.Assembly.);
return ci;
}
catch (Exception ex)
{
throw;
}
}
public class ThisComponent : Component
{
}
GetCallingAssembly doesn't return the Assembly that ThisComponent lives
in. It returns the assembly that the code that invoked the
GetAssemblyInfo. Also GetExecutingAssembly returns the assembly that
Component lives in. Check out the line above that is
fillComponentInfo(...).
The only thing i can think of now is a protected property that the
descendant sets in the constructor. I really don't want to have to add
that kind of thing to every Class that inherits from Component.
dan
operate on Class2's assembly information?
For instance:
public class Component
{
public virtual List<ComponentInfo> GetAssemblyInfo()
{
try
{
List<ComponentInfo> ci = new List<ComponentInfo>();
// how can Component get the assembly of its immediate descendant?
ci.Add(fillComponentInfo(System.Reflection.Assembly.);
return ci;
}
catch (Exception ex)
{
throw;
}
}
public class ThisComponent : Component
{
}
GetCallingAssembly doesn't return the Assembly that ThisComponent lives
in. It returns the assembly that the code that invoked the
GetAssemblyInfo. Also GetExecutingAssembly returns the assembly that
Component lives in. Check out the line above that is
fillComponentInfo(...).
The only thing i can think of now is a protected property that the
descendant sets in the constructor. I really don't want to have to add
that kind of thing to every Class that inherits from Component.
dan