Parent/Child Components: How to make the child components go away when deleting the Parent.

  • Thread starter Thread starter Patrick Vanden Driessche
  • Start date Start date
P

Patrick Vanden Driessche

Hi All,

I'm currently writing an in-house Form validation framework (WinForms) which
is based on 'Component'-inheriting object.

So basically, I have a small hierarchy.
FormValidator
+-- ControlValidator
+--ValidationRule

Via UITypeEditors, I got the part of managing the different
child-collections to work properly. (CollectionEditor)
But what I don't get is how can I make the child components go away from the
form designer if you delete the 'FormValidator' component (top-leve object)
from the Form's component tray.

In other terms, I'm lookig for the same behaviour as with the
TabControl/TabPages control relationship...but not for 'Control', but rather
'Component'-based objects.

I've read a few articles, have applied some attributes
(DesignerSerializationVisibility.Content) ... but I can't seem to get them
go away when you delete the top-level object.

Any help would be appreciated.

Patrick.
 
Hi, Patrick

I've started the process of escalating this issue to the product team.
Please bear with us.

Thank you for choosing the MSDN Managed Newsgroups,

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
--------------------
| From: "Patrick Vanden Driessche" <[email protected]>
| Subject: Parent/Child Components: How to make the child components go
away when deleting the Parent.
| Date: Thu, 13 Nov 2003 04:56:21 +0100
| Lines: 30
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi All,
|
| I'm currently writing an in-house Form validation framework (WinForms)
which
| is based on 'Component'-inheriting object.
|
| So basically, I have a small hierarchy.
| FormValidator
| +-- ControlValidator
| +--ValidationRule
|
| Via UITypeEditors, I got the part of managing the different
| child-collections to work properly. (CollectionEditor)
| But what I don't get is how can I make the child components go away from
the
| form designer if you delete the 'FormValidator' component (top-leve
object)
| from the Form's component tray.
|
| In other terms, I'm lookig for the same behaviour as with the
| TabControl/TabPages control relationship...but not for 'Control', but
rather
| 'Component'-based objects.
|
| I've read a few articles, have applied some attributes
| (DesignerSerializationVisibility.Content) ... but I can't seem to get them
| go away when you delete the top-level object.
|
| Any help would be appreciated.
|
| Patrick.
|
|
|
|
 
Hi John,

Thank you for the follow up ....

As you can image, I kept looking for a solution on this myself too ...and I
managed to find a solution in the meantime ...

For those interested, here's what I did:
As my problem is 'Design-Time' related I created a custom
'ComponentDesigner' class, which hooks up to the 'ComponentRemoving' event
of the 'IComponentChangeService'.
Through this event, I can detect when the user deletes the 'parent'
component from the form designer and manually remove the 'children' from the
same form source code persistence.

Thank you.

Patrick.
 
Hi, Patrick

Thanks for sharing your solution

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
--------------------
| From: "Patrick Vanden Driessche" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Parent/Child Components: How to make the child components go
away when deleting the Parent.
| Date: Fri, 14 Nov 2003 07:43:44 +0100
| Lines: 81
| Organization: DevBrains
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 173.128-136-217.adsl.skynet.be 217.136.128.173
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:156753
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi John,
|
| Thank you for the follow up ....
|
| As you can image, I kept looking for a solution on this myself too ...and
I
| managed to find a solution in the meantime ...
|
| For those interested, here's what I did:
| As my problem is 'Design-Time' related I created a custom
| 'ComponentDesigner' class, which hooks up to the 'ComponentRemoving' event
| of the 'IComponentChangeService'.
| Through this event, I can detect when the user deletes the 'parent'
| component from the form designer and manually remove the 'children' from
the
| same form source code persistence.
|
| Thank you.
|
| Patrick.
|
|
| | > Hi, Patrick
| >
| > I've started the process of escalating this issue to the product team.
| > Please bear with us.
| >
| > Thank you for choosing the MSDN Managed Newsgroups,
| >
| > John Eikanger
| > Microsoft Developer Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > --------------------
| > | From: "Patrick Vanden Driessche" <[email protected]>
| > | Subject: Parent/Child Components: How to make the child components go
| > away when deleting the Parent.
| > | Date: Thu, 13 Nov 2003 04:56:21 +0100
| > | Lines: 30
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Hi All,
| > |
| > | I'm currently writing an in-house Form validation framework (WinForms)
| > which
| > | is based on 'Component'-inheriting object.
| > |
| > | So basically, I have a small hierarchy.
| > | FormValidator
| > | +-- ControlValidator
| > | +--ValidationRule
| > |
| > | Via UITypeEditors, I got the part of managing the different
| > | child-collections to work properly. (CollectionEditor)
| > | But what I don't get is how can I make the child components go away
from
| > the
| > | form designer if you delete the 'FormValidator' component (top-leve
| > object)
| > | from the Form's component tray.
| > |
| > | In other terms, I'm lookig for the same behaviour as with the
| > | TabControl/TabPages control relationship...but not for 'Control', but
| > rather
| > | 'Component'-based objects.
| > |
| > | I've read a few articles, have applied some attributes
| > | (DesignerSerializationVisibility.Content) ... but I can't seem to get
| them
| > | go away when you delete the top-level object.
| > |
| > | Any help would be appreciated.
| > |
| > | Patrick.
| > |
| > |
| > |
| > |
| >
|
|
|
 
John...

We're trying to find out why you and other [MSFT] accounts' replies include
the entire header of the messages you respond to. Ours don't. Look at the
size of it and what it contains... the path? MimeOLE version information?

Can't this stuff be turned off? Or how can I turn mine on we may as well
all do it.

Thanks,
Tom
 
Hi, Tom

It is a limitation of our internal reader. The Tomcat reader keeps track
of a lot of extra stuff that we use internally for reporting. I trim the
excess headers out manually when I remember. If you folks find it that
irritating, I will see what it would cost to suppress them.

Let me know,

John Eikanger
Microsoft Developer Support
--------------------
| From: "Tom Leylan" <[email protected]>
| Subject: Re: Parent/Child Components: How to make the child components go
away when deleting the Parent.
| Date: Fri, 14 Nov 2003 14:37:45 -0500
| Lines: 139
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| John...
|
| We're trying to find out why you and other [MSFT] accounts' replies
include
| the entire header of the messages you respond to. Ours don't. Look at
the
| size of it and what it contains... the path? MimeOLE version information?
|
| Can't this stuff be turned off? Or how can I turn mine on we may as well
| all do it.
|
| Thanks,
| Tom
|
|
| | > Hi, Patrick
| >
| > Thanks for sharing your solution
| >
| > John Eikanger
| > Microsoft Developer Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > --------------------
| > | From: "Patrick Vanden Driessche" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Parent/Child Components: How to make the child components
| go
| > away when deleting the Parent.
| > | Date: Fri, 14 Nov 2003 07:43:44 +0100
| > | Lines: 81
| > | Organization: DevBrains
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: 173.128-136-217.adsl.skynet.be 217.136.128.173
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:156753
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Hi John,
| > |
| > | Thank you for the follow up ....
| > |
| > | As you can image, I kept looking for a solution on this myself too
| ...and
| > I
| > | managed to find a solution in the meantime ...
| > |
| > | For those interested, here's what I did:
| > | As my problem is 'Design-Time' related I created a custom
| > | 'ComponentDesigner' class, which hooks up to the 'ComponentRemoving'
| event
| > | of the 'IComponentChangeService'.
| > | Through this event, I can detect when the user deletes the 'parent'
| > | component from the form designer and manually remove the 'children'
from
| > the
| > | same form source code persistence.
| > |
| > | Thank you.
| > |
| > | Patrick.
| > |
| > |
| > | | > | > Hi, Patrick
| > | >
| > | > I've started the process of escalating this issue to the product
team.
| > | > Please bear with us.
| > | >
| > | > Thank you for choosing the MSDN Managed Newsgroups,
| > | >
| > | > John Eikanger
| > | > Microsoft Developer Support
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > --------------------
| > | > | From: "Patrick Vanden Driessche" <[email protected]>
| > | > | Subject: Parent/Child Components: How to make the child components
| go
| > | > away when deleting the Parent.
| > | > | Date: Thu, 13 Nov 2003 04:56:21 +0100
| > | > | Lines: 30
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > |
| > | > | Hi All,
| > | > |
| > | > | I'm currently writing an in-house Form validation framework
| (WinForms)
| > | > which
| > | > | is based on 'Component'-inheriting object.
| > | > |
| > | > | So basically, I have a small hierarchy.
| > | > | FormValidator
| > | > | +-- ControlValidator
| > | > | +--ValidationRule
| > | > |
| > | > | Via UITypeEditors, I got the part of managing the different
| > | > | child-collections to work properly. (CollectionEditor)
| > | > | But what I don't get is how can I make the child components go
away
| > from
| > | > the
| > | > | form designer if you delete the 'FormValidator' component
(top-leve
| > | > object)
| > | > | from the Form's component tray.
| > | > |
| > | > | In other terms, I'm lookig for the same behaviour as with the
| > | > | TabControl/TabPages control relationship...but not for 'Control',
| but
| > | > rather
| > | > | 'Component'-based objects.
| > | > |
| > | > | I've read a few articles, have applied some attributes
| > | > | (DesignerSerializationVisibility.Content) ... but I can't seem to
| get
| > | them
| > | > | go away when you delete the top-level object.
| > | > |
| > | > | Any help would be appreciated.
| > | > |
| > | > | Patrick.
| > | > |
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
Back
Top