SettingsCompiler.MaxValueAttribute.GetMaxValue C# (CSharp) Method

GetMaxValue() public static method

public static GetMaxValue ( FieldInfo field, float &maxValue ) : void
field System.Reflection.FieldInfo
maxValue float
return void
        public static void GetMaxValue(FieldInfo field, ref float maxValue)
        {
            MaxValueAttribute attr = field.GetCustomAttribute<MaxValueAttribute>();
            if(attr != null)
                maxValue = attr.MaxValueFloat;
        }

Same methods

MaxValueAttribute::GetMaxValue ( FieldInfo field, int &maxValue ) : void

Usage Example

 public IntSetting(int value, FieldInfo field, string group)
     : base(field, SettingType.Int, group)
 {
     Value = value;
     MinValueAttribute.GetMinValue(field, ref MinValue);
     MaxValueAttribute.GetMaxValue(field, ref MaxValue);
 }
All Usage Examples Of SettingsCompiler.MaxValueAttribute::GetMaxValue