internal static int RegisterType(string typeName, int expense, int initialThreshold) {
lock (internalSyncObject){
if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length) {
HandleType[] newTypes = new HandleType[handleTypeCount + 10];
if (handleTypes != null) {
Array.Copy(handleTypes, 0, newTypes, 0, handleTypeCount);
}
handleTypes = newTypes;
}
handleTypes[handleTypeCount++] = new HandleType(typeName, expense, initialThreshold);
return handleTypeCount;
}
}