[This is preliminary documentation and is subject to change.]

Static class that handles loading/saving configuration, contains config defaults, and various configuration-related utilities.

Namespace: fCraft
Assembly: fCraft (in fCraft.dll) Version: 0.6.3.0 (0.6.3.0)

Syntax

   
 C# 
public static class Config

Members

            
 All Members  Fields   Methods   Events  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
CurrentVersion
Latest version of config.xml available at the time of building this copy of fCraft. Config.xml files saved with this build will have this version number embedded.
Enabled
Attempts to parse given key's value as a boolean. Throws a FormatException on failure.
GetDefault
Provides the default value for a given ConfigKey.
GetDescription
Returns the description text for a given config key.
GetEnum``1
Attempts to parse a given key's value as an enumeration. An ArgumentException is thrown if value could not be parsed. Note the parsing is done in a case-insensitive way.
GetInt
Attempts to parse given key's value as an integer. Throws a FormatException on failure.
GetKeys
Returns a list of all keys in a section.
GetMetadata
Returns the metadata container (ConfigKeyAttribute object) for a given key.
GetSection
Returns the ConfigSection that a given key is associated with.
GetString
Returns raw value for the given key.
GetValueType
Returns the expected Type of the key's value, as specified in key metadata.
IsBlank
Checks whether any value has been set for a given key.
IsDefault
Checks whether given ConfigKey still has its default value.
KeyChanged
Occurs after a config key has been changed.
KeyChanging
Occurs when a config key is about to be changed (cancellable). The new value may be replaced by the callback.
Load(Boolean, Boolean)
Loads configuration from file.
LoadDefaults()()()()
Overwrites current settings with defaults.
LoadDefaults(ConfigSection)
Loads defaults for keys in a given ConfigSection.
ProtocolVersion
Supported version of the Minecraft classic protocol.
Reloaded
Occurs after the entire configuration has been reloaded from file.
ResetLogOptions()()()()
ResetRanks()()()()
Resets the list of ranks to defaults (guest/builder/op/owner). Warning: This method is not thread-safe, and should never be used on a live server.
ResetValue
Resets key value to its default setting.
Save()()()()
SetValue
Sets value of a given config key. Note that this method may throw exceptions if the given value is not acceptable. Use Config.TrySetValue() if you'd like to suppress exceptions in favor of a boolean return value.
TryGetBool
Attempts to parse a given key's value as a boolean.
TryGetInt
Attempts to parse a given key's value as an integer.
TrySetValue
Attempts to set the value of a given config key. Check the return value to make sure that the given value was acceptable.

Inheritance Hierarchy

System..::..Object
  fCraft..::..Config

See Also