static DebugHandleTracker() { tracker = new DebugHandleTracker(); if (CompModSwitches.HandleLeak.Level > TraceLevel.Off || CompModSwitches.TraceCollect.Enabled) { System.Internal.HandleCollector.HandleAdded += new System.Internal.HandleChangeEventHandler(tracker.OnHandleAdd); System.Internal.HandleCollector.HandleRemoved += new System.Internal.HandleChangeEventHandler(tracker.OnHandleRemove); } }
static DebugHandleTracker() { s_tracker = new DebugHandleTracker(); if (CompModSwitches.HandleLeak.Level > TraceLevel.Off || CompModSwitches.TraceCollect.Enabled) { HandleCollector.HandleAdded += new HandleChangeEventHandler(s_tracker.OnHandleAdd); HandleCollector.HandleRemoved += new HandleChangeEventHandler(s_tracker.OnHandleRemove); } }
static DebugHandleTracker() { handleTypes = new Hashtable(); internalSyncObject = new object(); tracker = new System.Internal.DebugHandleTracker(); if (System.ComponentModel.CompModSwitches.HandleLeak.Level > TraceLevel.Off || System.ComponentModel.CompModSwitches.TraceCollect.Enabled) { System.Internal.HandleCollector.HandleAdded += tracker.OnHandleAdd; System.Internal.HandleCollector.HandleRemoved += tracker.OnHandleRemove; } }
public string ToString(DebugHandleTracker.HandleType type) { StackParser parser = new StackParser(this.callStack); parser.DiscardTo("HandleCollector.Add"); parser.DiscardNext(); parser.Truncate(40); string str = ""; return (Convert.ToString((int) this.handle, 0x10) + str + ": " + parser.ToString()); }
public HandleEntry(DebugHandleTracker.HandleType.HandleEntry next, IntPtr handle) { this.handle = handle; this.next = next; if (System.ComponentModel.CompModSwitches.HandleLeak.Level > TraceLevel.Off) { this.callStack = Environment.StackTrace; } else { this.callStack = null; } }