Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8
|
BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8
This is the forum to discuss the Wrox book Professional C# 2008 by Christian Nagel, Bill Evjen, Jay Glynn, Morgan Skinner, Karli Watson; ISBN: 9780470191378
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 4th, 2011, 01:02 AM
Authorized User
 
Join Date: Mar 2011
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default Can some one explain this code Please ! I am having a hard time understanding this

using System;
public class ResourceHolder : IDisposable
{
private bool isDisposed = false;
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
if (disposing)
{
// Cleanup managed objects by calling their
// Dispose() methods.
}
// Cleanup unmanaged objects
}
isDisposed = true;
}
~ResourceHolder()
{
Dispose (false);
}
public void SomeMethod()
{
// Ensure object not already disposed before execution of any method
if(isDisposed)
{
throw new ObjectDisposedException(“ResourceHolder”);
}
// method implementation …
}
}
 
Old March 4th, 2011, 01:06 AM
Authorized User
 
Join Date: Mar 2011
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Okay ! I understood it Thanks ! :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
Can someone explain this code to me pandu345 Java Basics 2 October 6th, 2006 12:25 PM
could any one explain this code for me ? method Access VBA 1 August 13th, 2005 02:02 AM
Explain some code on p178 jgrasso BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 3rd, 2005 09:51 PM
Please explain this code : p131 top para ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 January 28th, 2005 06:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.