153
Console.WriteLine("\nObjects remaining to dispose = {0:d}", tracking.Count);
1
using System;
2
using System.Collections.Generic;
3
using System.Runtime.InteropServices;
4
5
// Design pattern for a base class.
6
public abstract class Base : IDisposable
7
{
8
private bool disposed = false;
9
private string instanceName;
10
private List<object> trackingList;
11
12
public Base(string instanceName, List<object> tracking)
13
{
14
this.instanceName = instanceName;
15
trackingList = tracking;
16
trackingList.Add(this);
17
}
18
19
public string InstanceName
20
{
21
get
22
{
23
return instanceName;
24
}
Cached Result