there are a lot of samples for designer classes. Some are storing internal
references to the services (componentchangeservice, selectionservice, etc.)
on the designer classes, some are getting them when needed. Are there
disadvantages on storing private references to such services rather than
getting them from designer host when needed? thanks...
Since there is no real documentation on this, go with your instinct. There
seems to be no harm we have found in storing references per-designer, but we
only store the most frequently used ones. For others we create private
properties to call GetService dynamically. It is safer to get the services
dynamically, since theoretically they can change. Looking at the service
provider code in reflector, I would say most references are fixed for the
lifetime of the designer.
Regards,
Frank Hileman
check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor
> there are a lot of samples for designer classes. Some are storing internal
> references to the services (componentchangeservice, selectionservice, etc.)
> on the designer classes, some are getting them when needed. Are there
> disadvantages on storing private references to such services rather than
> getting them from designer host when needed? thanks...
Joey Callisay - 19 Oct 2004 02:04 GMT
thanks a lot Sir Frank...
> Since there is no real documentation on this, go with your instinct. There
> seems to be no harm we have found in storing references per-designer, but we
[quoted text clipped - 18 lines]
> > disadvantages on storing private references to such services rather than
> > getting them from designer host when needed? thanks...