HighTechTalks DotNet Forums  

My own Collection in DesignTime and Delete Action

Dotnet Framework (WinForms DesignTime) microsoft.public.dotnet.framework.windowsforms.designtime


Discuss My own Collection in DesignTime and Delete Action in the Dotnet Framework (WinForms DesignTime) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Thibaud Bouquely
 
Posts: n/a

Default My own Collection in DesignTime and Delete Action - 06-15-2005 , 01:24 PM






Hello

I try to develop my own component with a collection property

Every thing work fine in Design Time except when I try delete the component,

Each sub component contains in collection property do not destroy and so,
InitializeComponent contains each sub component !! even if the main
component was destroyed !

NB :
My collection property have
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)
attribut
and I try to develop a ComponentDesigner with override procedure
AssociatedComponent to give the SubComponent collection but it does not work
!

I certainly forget something somewhere, could you help me please ?

thanks for your help !



Reply With Quote
  #2  
Old   
Phil Wright
 
Posts: n/a

Default Re: My own Collection in DesignTime and Delete Action - 06-15-2005 , 03:58 PM






You need to notify the design time environment that you have remove each of
the components inside the custom collection. So you need to ...

ITypeDescriptorContext context = (you get this context....)

// For each child component removed
context.Container.Remove(childComponent as IComponent);

// Then after all removed
context.OnComponentChanged()

Phil Wright
Follow my startup microISV at...
http://componentfactory.blogspot.com

"Thibaud Bouquely" <TBouquely (AT) NOSPAM (DOT) fr> wrote

Quote:
Hello

I try to develop my own component with a collection property

Every thing work fine in Design Time except when I try delete the
component,

Each sub component contains in collection property do not destroy and so,
InitializeComponent contains each sub component !! even if the main
component was destroyed !

NB :
My collection property have
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)
attribut
and I try to develop a ComponentDesigner with override procedure
AssociatedComponent to give the SubComponent collection but it does not
work
!

I certainly forget something somewhere, could you help me please ?

thanks for your help !





Reply With Quote
  #3  
Old   
Thibaud Bouquely
 
Posts: n/a

Default Re: My own Collection in DesignTime and Delete Action - 06-15-2005 , 04:28 PM



thanks a lot for your help

I just find this article :
http://www.divil.co.uk/net/articles/designers/collectioncontrols.asp

where the author explain It necessary to use IComponentChangeService and
ComponentRemoved Event

your approch is different but i am not sure I understand

I already use ITypeDescriptorContext in Converter but the IDE give me an
instance of it, I never obtain it from something

(you get this context....) : How can I do this ? (with GetService method may
be on site of My component ???) and Where I must do this ? (in main
component in dispose method for example or in specific ComponentDesigner of
main component ?)



"Phil Wright" <phil.wright (AT) dotnetmagic (DOT) com> a écrit dans le message de
news:%23o2bH0ecFHA.3032 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
You need to notify the design time environment that you have remove each
of
the components inside the custom collection. So you need to ...

ITypeDescriptorContext context = (you get this context....)

// For each child component removed
context.Container.Remove(childComponent as IComponent);

// Then after all removed
context.OnComponentChanged()

Phil Wright
Follow my startup microISV at...
http://componentfactory.blogspot.com

"Thibaud Bouquely" <TBouquely (AT) NOSPAM (DOT) fr> wrote in message
news:ORxmaddcFHA.3492 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hello

I try to develop my own component with a collection property

Every thing work fine in Design Time except when I try delete the
component,

Each sub component contains in collection property do not destroy and
so,
InitializeComponent contains each sub component !! even if the main
component was destroyed !

NB :
My collection property have
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)
attribut
and I try to develop a ComponentDesigner with override procedure
AssociatedComponent to give the SubComponent collection but it does not
work
!

I certainly forget something somewhere, could you help me please ?

thanks for your help !







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.