internal static void AddDeviceContext(DeviceContext dc) { if (activeDeviceContexts == null) { activeDeviceContexts = new System.Windows.Forms.ClientUtils.WeakRefCollection(); activeDeviceContexts.RefCheckThreshold = 20; } if (!activeDeviceContexts.Contains(dc)) { dc.Disposing += new EventHandler(DeviceContexts.OnDcDisposing); activeDeviceContexts.Add(dc); } }
internal static void AddDeviceContext(DeviceContext dc) { if (activeDeviceContexts == null) { activeDeviceContexts = new System.Windows.Forms.ClientUtils.WeakRefCollection(); activeDeviceContexts.RefCheckThreshold = 20; } if (!activeDeviceContexts.Contains(dc)) { dc.Disposing += new EventHandler(DeviceContexts.OnDcDisposing); activeDeviceContexts.Add(dc); } }
public override bool Equals(object obj) { System.Windows.Forms.ClientUtils.WeakRefCollection refs = obj as System.Windows.Forms.ClientUtils.WeakRefCollection; if (refs != this) { if ((refs == null) || (this.Count != refs.Count)) { return(false); } for (int i = 0; i < this.Count; i++) { if ((this.InnerList[i] != refs.InnerList[i]) && ((this.InnerList[i] == null) || !this.InnerList[i].Equals(refs.InnerList[i]))) { return(false); } } } return(true); }
private static void Copy(System.Windows.Forms.ClientUtils.WeakRefCollection sourceList, int sourceIndex, System.Windows.Forms.ClientUtils.WeakRefCollection destinationList, int destinationIndex, int length) { if (sourceIndex < destinationIndex) { sourceIndex += length; destinationIndex += length; while (length > 0) { destinationList.InnerList[--destinationIndex] = sourceList.InnerList[--sourceIndex]; length--; } } else { while (length > 0) { destinationList.InnerList[destinationIndex++] = sourceList.InnerList[sourceIndex++]; length--; } } }