471,603 Members | 1,503 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

Dispose() in Partial Class

I have been migrating my code from .NET 1.1 framework to .NET 2.0 framework.
With the designer generated code, the Dispose() method is put in the
<Name>.Designer.cs partial class.
How is it possible to add resource cleanup code to a user control/form (as I
used to do in the Dispose() method before partial classes)?

Many thanks.
Feb 10 '06 #1
1 3057
James,

You can always register for the Disposed event. This event is called
only when the Dispose method is called, not when an object is finalized.
You can call Dispose on your resources there.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JamesB" <Ja****@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.com...
I have been migrating my code from .NET 1.1 framework to .NET 2.0
framework.
With the designer generated code, the Dispose() method is put in the
<Name>.Designer.cs partial class.
How is it possible to add resource cleanup code to a user control/form (as
I
used to do in the Dispose() method before partial classes)?

Many thanks.

Feb 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Gomaw Beoyr | last post: by
3 posts views Thread by Lelekács Zoltán | last post: by
16 posts views Thread by pawel.pabich | last post: by
156 posts views Thread by Dennis | last post: by
9 posts views Thread by Fat Elvis | last post: by
4 posts views Thread by SteveT | last post: by
5 posts views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.