473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

partial class (designer created) and Dispose override

Hi,

I would like to use a thread together with an object.
In the constructor of the object I create the thread and I would like to
dispose in the Dispose method of the object, but it is already defined of
the designer created partial class of the object.
What is the nice solution to dispose the thread? Can I modify the overrided
method in the designer created partial class?

lelez
-----------------------------------
http://www.lelez.hu
http://www.csitcset.hu
ICQ: 177465172
Nov 17 '05 #1
3 4496
Lelekács,

You should be able to modify that file. The implementation of Dispose
falls outside of the region for windows forms designer generated code.

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

"Lelekács Zoltán" <le***@freemail.hu> wrote in message
news:en**************@TK2MSFTNGP14.phx.gbl...
Hi,

I would like to use a thread together with an object.
In the constructor of the object I create the thread and I would like to
dispose in the Dispose method of the object, but it is already defined of
the designer created partial class of the object.
What is the nice solution to dispose the thread? Can I modify the
overrided method in the designer created partial class?

lelez
-----------------------------------
http://www.lelez.hu
http://www.csitcset.hu
ICQ: 177465172

Nov 17 '05 #2
"Lelekács Zoltán" <le***@freemail.hu> wrote in message
news:en**************@TK2MSFTNGP14.phx.gbl...
Hi,

I would like to use a thread together with an object.
In the constructor of the object I create the thread and I would like to
dispose in the Dispose method of the object, but it is already defined of
the designer created partial class of the object.
What is the nice solution to dispose the thread? Can I modify the
overrided method in the designer created partial class?

lelez
-----------------------------------
http://www.lelez.hu
http://www.csitcset.hu
ICQ: 177465172


The thread class doesn't implement IDisposable - what do you want to do to
the thread, halt it?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 17 '05 #3
Yes, but the question was about Dispose method generaly.
It's a little bit strange for me to add a language element to C# to separate
the "generated" and the "edited" code, and after it I have to modify the
generated code... Not nice...I think...

For me the "old fashioned way" was nicer when there was no partial word. Now
I have to keep in mind that some code in a separated file...

lelez
-----------------------------------
http://www.lelez.hu
http://www.csitcset.hu
ICQ: 177465172
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sebastian Sylvan | last post by:
Hey. I have two questions. First of all I'm using the Visual C# Express Beta. When you create a windows application it will automatically split the main form into two files using partial...
1
by: Dan Kelley | last post by:
I have 2 projects - 1 Winform project that sends Udp messages using the UdpClient class when a button is clicked, and a Console application that listens for these Udp messages. If I try to use...
3
by: Richard | last post by:
I have a requirement to put a GDI style circle or rectangle border around the selected row of a datagrid/ It will overlap into the row above and below the selected row. Doing this in a the OnPaint...
7
by: erin.sebastian | last post by:
Hello Everyone, This is my first attempt at coding using an abstract class and i am getting an error i can't figure out. Here is the back ground. I have a project that contains an abstract...
4
by: Grigs | last post by:
Hello, I have a fairly simple class that I created and it works great. Basically it remembers a certain amount of strings. When a new one comes in the oldest drops off. The problem is, when I...
3
by: Rene | last post by:
VS 2005 uses the Partial Class & <form>.Designer.cs for its windows forms generated code. When upgrading from 2003 the project wizard did not break the form, it left it the old way. I would like...
1
by: JamesB | last post by:
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...
3
by: erich | last post by:
In VS2005, creating a new form creates the form class and a partial (frm*.designer.vb) class file and displays the partial class beneath the main form frm*.vb, which is great. However, when...
7
by: tshad | last post by:
I have a problem with a VS 2003 project. This project was designed and works fine in VS 2003. But trying to open the project I get the following error....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.