Re: Mandatory component class instantiation ...
From: Dave (Dave_at_discussions.microsoft.com)
Date: 10/22/04
- Next message: Olaf Baeyens: "Re: C++ for .NET question"
- Previous message: Jonathan Wilson: "C++ for .NET question"
- In reply to: Tomas Restrepo \(MVP\): "Re: Mandatory component class instantiation ..."
- Next in thread: Tomas Restrepo \(MVP\): "Re: Mandatory component class instantiation ..."
- Reply: Tomas Restrepo \(MVP\): "Re: Mandatory component class instantiation ..."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 06:17:04 -0700
Well, we did considered that option, but how would you localize the custom
attribute for different languages. The display name of the component
obviously will be different in Spanish or German, but you can't localize
custom attribute. Am I correct? Could you comment.
"Tomas Restrepo (MVP)" wrote:
> Dave,
>
> > We have developed a few .NET components. The application access these
> > components through well defined interface IOurInterface.
> >
> > The application list display name of each component in the dialog, so
> > user can choose which one he wants to use. To display list of available
> > components we have to associate human redable display name with each
> > component.
> >
> > To get that display name of component we added the method GetDisplayName
> to
> > IOurInterface.
> >
> > The implication is that we have to instantiate class that implements
> > IOurInterface
> > in all components, so we can call GetDisplayName method of each instance.
> > We don't know other ways to get display name of component. The static
> method
> > would be great but we can't add static method to interface IOurInterface.
> >
> > Can anyone suggest the better way to list human redable display name of
> > components without instantiating all components. Thanks.
>
> How about querying for a custom attribute on the type using reflection?
> Works wonders for all the VS.NET designers and quite a few other things...
>
> --
> Tomas Restrepo
> tomasr@mvps.org
>
>
>
- Next message: Olaf Baeyens: "Re: C++ for .NET question"
- Previous message: Jonathan Wilson: "C++ for .NET question"
- In reply to: Tomas Restrepo \(MVP\): "Re: Mandatory component class instantiation ..."
- Next in thread: Tomas Restrepo \(MVP\): "Re: Mandatory component class instantiation ..."
- Reply: Tomas Restrepo \(MVP\): "Re: Mandatory component class instantiation ..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|