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

Attempts to set the value of a given config key. Check the return value to make sure that the given value was acceptable.

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

Syntax

   
 C# 
public static bool TrySetValue(
	this ConfigKey key,
	Object rawValue
)

Parameters

key
ConfigKey
Config key to set.
rawValue
Object
Value to assign to the key. If passed object is not a string, rawValue.ToString() is used.

Return Value

True if value is valid and has been assigned. False if value was invalid, or if assignment was cancelled by an event handler/plugin.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ConfigKey. When you use instance method syntax to call this method, omit the first parameter.

Exceptions

See Also