Exemple #1
0
 internal static void AddDeviceContext(DeviceContext dc)
 {
     if (activeDeviceContexts == null)
     {
         activeDeviceContexts = new System.Drawing.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.Drawing.ClientUtils.WeakRefCollection();
         activeDeviceContexts.RefCheckThreshold = 20;
     }
     if (!activeDeviceContexts.Contains(dc))
     {
         dc.Disposing += new EventHandler(DeviceContexts.OnDcDisposing);
         activeDeviceContexts.Add(dc);
     }
 }
Exemple #3
0
 public override bool Equals(object obj)
 {
     System.Drawing.ClientUtils.WeakRefCollection refs = obj as System.Drawing.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);
 }
Exemple #4
0
 private static void Copy(System.Drawing.ClientUtils.WeakRefCollection sourceList, int sourceIndex, System.Drawing.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--;
         }
     }
 }