G
Guest
I have class that also uses a custom editor that, when compiled directly into
my project, works just fine in a propertygrid. However, it was necessary to
place that class into a DLL, hense the editor was also moved into the DLL and
compiled. The issue I have is the the editor is now inactive. Can someone
tell me why this may be?
Here is the code for the property in my class that uses the editor. This
code resides within the DLL.
/// <summary>
/// This is the core WMI data that is being checked.
/// </summary>
[Description("Inspects WMI data on the system."),
Category("Data")
Editor(typeof(TestingWmi.MyWMIEditor),typeof(System.Drawing.Design.UITypeEditor)),
DefaultValue(null), Browsable(true)]
public TestingWmi.WMIData MyWMIData
{
get { return this.wmiData; }
set { this.wmiData = value; }
}
The following code instanciates an instance of the class (which references
the editor) within this dll. This method exists within my main program.
public object CreateClassInstance(Assembly dllAssembly, string strType)
{
// Get a reference to the default constructor.
System.Type componentType = dllAssembly.GetType(strType);
if (componentType != null)
{
// Get the default constructor for this derived class of
PropertyBase.
ConstructorInfo constructorInfoObj =
componentType.GetConstructor(Type.EmptyTypes);
// Invoke the constructor.
object cinfo = constructorInfoObj.Invoke(null);
return cinfo;
}
return null;
}
I'd like to understand why the editor, when called from within the DLL is
inactive, but when called directly from within the code, it is active.
my project, works just fine in a propertygrid. However, it was necessary to
place that class into a DLL, hense the editor was also moved into the DLL and
compiled. The issue I have is the the editor is now inactive. Can someone
tell me why this may be?
Here is the code for the property in my class that uses the editor. This
code resides within the DLL.
/// <summary>
/// This is the core WMI data that is being checked.
/// </summary>
[Description("Inspects WMI data on the system."),
Category("Data")
Editor(typeof(TestingWmi.MyWMIEditor),typeof(System.Drawing.Design.UITypeEditor)),
DefaultValue(null), Browsable(true)]
public TestingWmi.WMIData MyWMIData
{
get { return this.wmiData; }
set { this.wmiData = value; }
}
The following code instanciates an instance of the class (which references
the editor) within this dll. This method exists within my main program.
public object CreateClassInstance(Assembly dllAssembly, string strType)
{
// Get a reference to the default constructor.
System.Type componentType = dllAssembly.GetType(strType);
if (componentType != null)
{
// Get the default constructor for this derived class of
PropertyBase.
ConstructorInfo constructorInfoObj =
componentType.GetConstructor(Type.EmptyTypes);
// Invoke the constructor.
object cinfo = constructorInfoObj.Invoke(null);
return cinfo;
}
return null;
}
I'd like to understand why the editor, when called from within the DLL is
inactive, but when called directly from within the code, it is active.