public static AddVarRO ( |
||
bar | The tweak bar to which adding a new variable. | |
name | String | The name of the variable. It will be displayed in the tweak bar if no label is specified for this variable. It will also be used to refer to this variable in other functions. |
type | VariableType | Type of the variable. It must be one of the |
var | Pointer to the variable linked to this entry. | |
def | String | An optional definition string used to modify the behavior of this new entry. |
return | void |
public static void AddVarRO(IntPtr bar, String name, VariableType type, IntPtr var, String def)
{
if (bar == IntPtr.Zero) {
throw new ArgumentOutOfRangeException("bar");
} else if (type == VariableType.Undefined) {
throw new ArgumentOutOfRangeException("type");
} else if (var == IntPtr.Zero) {
throw new ArgumentOutOfRangeException("var");
} else if (name == null) {
throw new ArgumentNullException("name");
}
if (!NativeMethods.TwAddVarRO(bar, name, type, var, def)) {
throw new AntTweakBarException("TwAddVarRO failed.");
}
}