Example #1
0
 /// <summary>
 /// Gets an enum property from the dictionaries.
 /// </summary>
 /// <param name="propertyName">The name of the property to look for</param>
 /// <param name="defaultValue">If the property was not found, use this instead. Pass null if this is a required property.</param>
 public ThingEnum GetEnumProperty(string propertyName, ThingEnum? defaultValue)
 {
     ThingEnum te;
     if (EnumTokens.TryGetValue(propertyName.ToLower(), out te))
         return te;
     else if (defaultValue == null)
         throw new ArgumentException("That property was not found in the .thing file!", propertyName);
     else
         return (ThingEnum) defaultValue;
 }
 internal static IThing MakeThing(ThingEnum type)
 {
     return(ctors[type]());
 }