Click here to Skip to main content
15,905,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to check operating system in c#..? Pin
Dave Kreskowiak20-May-10 6:35
mveDave Kreskowiak20-May-10 6:35 
GeneralRe: how to check operating system in c#..? Pin
Johnny J.20-May-10 21:01
professionalJohnny J.20-May-10 21:01 
GeneralRe: how to check operating system in c#..? Pin
Dave Kreskowiak21-May-10 1:45
mveDave Kreskowiak21-May-10 1:45 
AnswerRe: how to check operating system in c#..? Pin
canangirgin20-May-10 4:41
canangirgin20-May-10 4:41 
QuestionDisposing of object used in a UserControl... Pin
Shy Agam19-May-10 21:40
Shy Agam19-May-10 21:40 
AnswerRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon19-May-10 22:11
mvePete O'Hanlon19-May-10 22:11 
GeneralRe: Disposing of object used in a UserControl... Pin
Luc Pattyn20-May-10 3:20
sitebuilderLuc Pattyn20-May-10 3:20 
GeneralRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon20-May-10 3:50
mvePete O'Hanlon20-May-10 3:50 
Wow, talk about going way beyond the original problem. Right, here are some thoughts based on work we've done with this in the past.

If you want to show the same image in multiple locations then you don't make the lifetime of the image the responsibility of the items that are showing it. In other words, I'd have an ImageManager class that contained the image. When the controls want the image, then I would return a clone of that image to the control instead - the control can then happily dispose of that image. The lifetime of the ImageManager is then independent of the user control and can be maintained as a WeakReference.

We have used this technique successfully in several projects and it's worked well for us.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: Disposing of object used in a UserControl... Pin
Luc Pattyn20-May-10 4:00
sitebuilderLuc Pattyn20-May-10 4:00 
GeneralRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon20-May-10 4:03
mvePete O'Hanlon20-May-10 4:03 
GeneralRe: Disposing of object used in a UserControl... Pin
Luc Pattyn20-May-10 4:05
sitebuilderLuc Pattyn20-May-10 4:05 
GeneralRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon20-May-10 4:17
mvePete O'Hanlon20-May-10 4:17 
GeneralRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon21-May-10 11:40
mvePete O'Hanlon21-May-10 11:40 
GeneralRe: Disposing of object used in a UserControl... Pin
Luc Pattyn21-May-10 11:56
sitebuilderLuc Pattyn21-May-10 11:56 
GeneralRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon21-May-10 12:51
mvePete O'Hanlon21-May-10 12:51 
GeneralRe: Disposing of object used in a UserControl... Pin
Luc Pattyn21-May-10 13:05
sitebuilderLuc Pattyn21-May-10 13:05 
AnswerRe: Disposing of object used in a UserControl... Pin
Pete O'Hanlon21-May-10 12:53
mvePete O'Hanlon21-May-10 12:53 
QuestionDistribute values Pin
Bart Van Eyndhoven19-May-10 21:19
Bart Van Eyndhoven19-May-10 21:19 
QuestionMessage Removed Pin
19-May-10 19:30
EthicsGradient19-May-10 19:30 
AnswerRe: How to clear FileSystemWatcher.Path ? [modified] Pin
Johnny J.19-May-10 22:39
professionalJohnny J.19-May-10 22:39 
GeneralMessage Removed Pin
20-May-10 14:33
EthicsGradient20-May-10 14:33 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Johnny J.20-May-10 19:55
professionalJohnny J.20-May-10 19:55 
GeneralMessage Removed Pin
21-May-10 3:34
EthicsGradient21-May-10 3:34 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Johnny J.21-May-10 3:38
professionalJohnny J.21-May-10 3:38 
GeneralMessage Removed Pin
21-May-10 13:58
EthicsGradient21-May-10 13:58 

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.