|
using System.Collections;
using Storm.TextEditor.Drawing.GDI;
namespace Storm.TextEditor.Core
{
public class MemoryHandler
{
#region Fields
private static ArrayList heap = new ArrayList();
#endregion
#region Properties
public static GDIObject[] Items
{
get
{
ArrayList al = new ArrayList();
foreach (GDIObject go in heap)
{
if (go != null)
al.Add(go);
}
GDIObject[] gos = new GDIObject[al.Count];
al.CopyTo(0, gos, 0, al.Count);
return gos;
}
}
#endregion
#region Methods
#region Public
public static void Add(GDIObject item)
{
heap.Add(item);
}
public static void Remove(GDIObject item)
{
if (heap.Contains(item))
heap.Remove(item);
}
public static void DestroyAll()
{
foreach (GDIObject go in Items)
go.Dispose();
}
#endregion
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.