Tanoda
Leap.Config Class Reference

The Config class provides access to Leap Motion system configuration information. More...

Public Types

enum  ValueType {
  TYPE_UNKNOWN = 0 , TYPE_BOOLEAN = 1 , TYPE_INT32 = 2 , TYPE_FLOAT = 6 ,
  TYPE_STRING = 8
}
 Enumerates the possible data types for configuration values. More...
 

Public Member Functions

 Config (Connection.Key connectionKey)
 Creates a new Config object for setting runtime configuration settings. More...
 
 Config (int connectionId)
 
bool Get< T > (string key, Action< T > onResult)
 Requests a configuration value. More...
 
bool Set< T > (string key, T value, Action< bool > onResult)
 Sets a configuration value. More...
 
ValueType Type (string key)
 
bool GetBool (string key)
 
bool SetBool (string key, bool value)
 
bool GetInt32 (string key)
 
bool SetInt32 (string key, int value)
 
bool GetFloat (string key)
 
bool SetFloat (string key, float value)
 
bool GetString (string key)
 
bool SetString (string key, string value)
 
bool Save ()
 

Detailed Description

The Config class provides access to Leap Motion system configuration information.

Since
1.0

Definition at line 20 of file Config.cs.

Member Enumeration Documentation

◆ ValueType

Enumerates the possible data types for configuration values.

Since
1.0
Enumerator
TYPE_UNKNOWN 
TYPE_BOOLEAN 
TYPE_INT32 
TYPE_FLOAT 
TYPE_STRING 

Definition at line 164 of file Config.cs.

Constructor & Destructor Documentation

◆ Config() [1/2]

Leap.Config.Config ( Connection.Key  connectionKey)

Creates a new Config object for setting runtime configuration settings.

Note that the Controller.Config provides a properly initialized Config object already.

Since
3.0

Definition at line 30 of file Config.cs.

◆ Config() [2/2]

Leap.Config.Config ( int  connectionId)

Definition at line 35 of file Config.cs.

Member Function Documentation

◆ Get< T >()

bool Leap.Config.Get< T > ( string  key,
Action< T >  onResult 
)

Requests a configuration value.

You must provide an action to take when the Leap service returns the config value. The Action delegate must take a parameter matching the config value type. The current value of the setting is passed to this delegate.

Since
3.0

Definition at line 82 of file Config.cs.

◆ GetBool()

bool Leap.Config.GetBool ( string  key)

Definition at line 116 of file Config.cs.

◆ GetFloat()

bool Leap.Config.GetFloat ( string  key)

Definition at line 136 of file Config.cs.

◆ GetInt32()

bool Leap.Config.GetInt32 ( string  key)

Definition at line 126 of file Config.cs.

◆ GetString()

bool Leap.Config.GetString ( string  key)

Definition at line 146 of file Config.cs.

◆ Save()

bool Leap.Config.Save ( )

Definition at line 156 of file Config.cs.

◆ Set< T >()

bool Leap.Config.Set< T > ( string  key,
value,
Action< bool >  onResult 
)

Sets a configuration value.

You must provide an action to take when the Leap service sets the config value. The Action delegate must take a boolean parameter. The service calls this delegate with the value true if the setting was changed successfully and false, otherwise.

Since
3.0
Type Constraints
T :IConvertible 

Definition at line 100 of file Config.cs.

◆ SetBool()

bool Leap.Config.SetBool ( string  key,
bool  value 
)

Definition at line 121 of file Config.cs.

◆ SetFloat()

bool Leap.Config.SetFloat ( string  key,
float  value 
)

Definition at line 141 of file Config.cs.

◆ SetInt32()

bool Leap.Config.SetInt32 ( string  key,
int  value 
)

Definition at line 131 of file Config.cs.

◆ SetString()

bool Leap.Config.SetString ( string  key,
string  value 
)

Definition at line 151 of file Config.cs.

◆ Type()

ValueType Leap.Config.Type ( string  key)

Definition at line 111 of file Config.cs.


The documentation for this class was generated from the following file: