コード例 #1
0
 public static int RegisterType(string typeName, int expense, int initialThreshold)
 {
     int num1;
     lock (HandleCollector.internalSyncObject)
     {
         if ((HandleCollector.handleTypeCount == 0) || (HandleCollector.handleTypeCount == HandleCollector.handleTypes.Length))
         {
             HandleCollector.HandleType[] typeArray1 = new HandleCollector.HandleType[HandleCollector.handleTypeCount + 10];
             if (HandleCollector.handleTypes != null)
             {
                 Array.Copy(HandleCollector.handleTypes, 0, typeArray1, 0, HandleCollector.handleTypeCount);
             }
             HandleCollector.handleTypes = typeArray1;
         }
         HandleCollector.handleTypes[HandleCollector.handleTypeCount++] = new HandleCollector.HandleType(typeName, expense, initialThreshold);
         num1 = HandleCollector.handleTypeCount;
     }
     return num1;
 }
コード例 #2
0
        public static int RegisterType(string typeName, int expense, int initialThreshold)
        {
            int num1;

            lock (HandleCollector.internalSyncObject)
            {
                if ((HandleCollector.handleTypeCount == 0) || (HandleCollector.handleTypeCount == HandleCollector.handleTypes.Length))
                {
                    HandleCollector.HandleType[] typeArray1 = new HandleCollector.HandleType[HandleCollector.handleTypeCount + 10];
                    if (HandleCollector.handleTypes != null)
                    {
                        Array.Copy(HandleCollector.handleTypes, 0, typeArray1, 0, HandleCollector.handleTypeCount);
                    }
                    HandleCollector.handleTypes = typeArray1;
                }
                HandleCollector.handleTypes[HandleCollector.handleTypeCount++] = new HandleCollector.HandleType(typeName, expense, initialThreshold);
                num1 = HandleCollector.handleTypeCount;
            }
            return(num1);
        }