Beispiel #1
0
        public static void RegisterConstructor(FieldConstructor constructor)
        {
            int idx;

            if (TryFindConstructor(constructor.DataType, out idx))
            {
                throw new ArgumentException(string.Format(Properties.Resources.FieldFactory_RegisterConstructor_TypeAlreadyRegistered, constructor.DataType));
            }
            else
            {
                if (TryFindConstructor(constructor.DataTypeName, out idx))
                {
                    throw new ArgumentException(string.Format(Properties.Resources.FieldFactory_RegisterConstructor_NameAlreadyRegistered, constructor.DataTypeName));
                }
                else
                {
                    constructorList.Add(constructor);
                }
            }
        }
Beispiel #2
0
 public static void UnregisterConstructor(FieldConstructor constructor)
 {
     constructorList.Remove(constructor);
 }