Fred Chen wrote:
> I would like my component to reference the runtime assembly when it is
> added to a form. (The reason for this is because my component in the
> design-time assembly is derived from the Component class, and I don't
> want to expose that class to the user)
I don't understand, your component at runtime should also derive from
Component, otherwise it is not a component! If you don't derive from
Component you don't get features that the runtime container and the control
need (for example Dispose()).
Your control can behave differently at designtime and runtime by checking
the Component.DesignMode property. For example, at runtime your component
could access a remote machine, but at design time it could simulate the
connection.
> For the CompactFramework you can use the RuntimeAssemblyAttribute in
> System.CF.Design.
The reason for this is that the compact framework is a totally different
framework to the desktop version, so you need two versions of the control:
one that the compact framework will accept so you can test the component on
the actual smart device; the other version is used in the designer which
cannot use the compact framework version because it runs on the desktop.
> Is there a simular attribute that is that can be used in the full
> Framework?
not that I know of, but then again, I don't understand that there is a
reason for it
Richard
--
my email
(E-Mail Removed) is encrypted with ROT13 (
www.rot13.org)