Click here to Skip to main content
15,914,386 members
Home / Discussions / C#
   

C#

 
GeneralRe: get,set methods Pin
blackjack215016-Apr-07 4:07
blackjack215016-Apr-07 4:07 
GeneralRe: get,set methods Pin
Colin Angus Mackay16-Apr-07 4:31
Colin Angus Mackay16-Apr-07 4:31 
GeneralRe: get,set methods Pin
Thomas Stockwell16-Apr-07 10:45
professionalThomas Stockwell16-Apr-07 10:45 
GeneralRe: get,set methods Pin
Luc Pattyn16-Apr-07 4:18
sitebuilderLuc Pattyn16-Apr-07 4:18 
Questionset this object to null Pin
Matglas16-Apr-07 2:51
Matglas16-Apr-07 2:51 
AnswerRe: set this object to null Pin
_mubashir16-Apr-07 3:07
_mubashir16-Apr-07 3:07 
QuestionRe: set this object to null Pin
Matglas16-Apr-07 3:14
Matglas16-Apr-07 3:14 
AnswerRe: set this object to null Pin
Colin Angus Mackay16-Apr-07 3:20
Colin Angus Mackay16-Apr-07 3:20 
The answer is no because the the object does not have any knowledge of who holds a reference to it.

There may, however, be a way around it using weak references. The problem with that solution is that the point at which the references become null is non-deterministic.

You could also implement IDisposable and Dispose of the internals of the object when you don't need it. However, anything accessing the object would have to be able to handle the fact that the object may exist, but it has already been disposed of.

The above work arounds do not take into account the overall big picture. It would be better to know what it is you are trying to achieve. That way we could probably suggest a better solution.




Upcoming events:
* Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services...

Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton


My website

AnswerRe: set this object to null Pin
Luc Pattyn16-Apr-07 3:26
sitebuilderLuc Pattyn16-Apr-07 3:26 
AnswerRe: set this object to null Pin
Colin Angus Mackay16-Apr-07 3:18
Colin Angus Mackay16-Apr-07 3:18 
QuestionRe: set this object to null Pin
Matglas16-Apr-07 3:31
Matglas16-Apr-07 3:31 
AnswerRe: set this object to null Pin
Dan Neely16-Apr-07 3:37
Dan Neely16-Apr-07 3:37 
GeneralRe: set this object to null Pin
Matglas16-Apr-07 3:50
Matglas16-Apr-07 3:50 
GeneralRe: set this object to null Pin
Matglas16-Apr-07 3:42
Matglas16-Apr-07 3:42 
QuestionRichtext Box undo Pin
7116-Apr-07 2:42
7116-Apr-07 2:42 
AnswerRe: Richtext Box undo Pin
Pete O'Hanlon16-Apr-07 2:50
mvePete O'Hanlon16-Apr-07 2:50 
QuestionC# Threading Controls on a Form Pin
ATCsharp16-Apr-07 2:41
ATCsharp16-Apr-07 2:41 
AnswerRe: C# Threading Controls on a Form Pin
Martin#16-Apr-07 2:46
Martin#16-Apr-07 2:46 
GeneralRe: C# Threading Controls on a Form Pin
ATCsharp16-Apr-07 2:52
ATCsharp16-Apr-07 2:52 
AnswerRe: C# Threading Controls on a Form Pin
Leslie Sanford16-Apr-07 3:51
Leslie Sanford16-Apr-07 3:51 
Questionconverting C++ pseudo-code to C#.NET [modified] Pin
Software_Specialist16-Apr-07 1:50
Software_Specialist16-Apr-07 1:50 
AnswerRe: converting C++ pseudo-code to C#.NET Pin
Stefan Troschuetz16-Apr-07 2:20
Stefan Troschuetz16-Apr-07 2:20 
GeneralRe: converting C++ pseudo-code to C#.NET Pin
Software_Specialist16-Apr-07 2:43
Software_Specialist16-Apr-07 2:43 
AnswerRe: converting C++ pseudo-code to C#.NET Pin
sulabh202016-Apr-07 2:24
sulabh202016-Apr-07 2:24 
GeneralRe: converting C++ pseudo-code to C#.NET Pin
Software_Specialist16-Apr-07 3:39
Software_Specialist16-Apr-07 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.