Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / June 2005

Tip: Looking for answers? Try searching our database.

My own Collection in DesignTime and Delete Action

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thibaud Bouquely - 15 Jun 2005 19:24 GMT
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(DesignerSerializationVisibility.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 !
Phil Wright - 15 Jun 2005 21:58 GMT
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

> Hello
>
[quoted text clipped - 19 lines]
>
> thanks for your help !
Thibaud Bouquely - 15 Jun 2005 22:28 GMT
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 ?)

> You need to notify the design time environment that you have remove each of
> the components inside the custom collection. So you need to ...
[quoted text clipped - 34 lines]
> >
> > thanks for your help !

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.