fCraft.Config.ValidateEnum C# (CSharp) Method

ValidateEnum() private method

private ValidateEnum ( string key, string value ) : bool
key string
value string
return bool
        bool ValidateEnum( string key, string value, params string[] options ) {
            for( int i = 0; i < options.Length; i++ ) {
                if( value.ToLowerInvariant() == options[i].ToLowerInvariant() ) {
                    settings[key] = options[i];
                    return true;
                }
            }
            Log( "Config.SetValue: Invalid option specified for {0}. " +
                    "See documentation for the list of permitted options. Using default: {1}", LogType.Warning,
                    key, settings[key] );
            return false;
        }