static bool OnOffArg( CompositorScriptContext context, string introducer, string[] args ) { if ( OptionCount( context, introducer, 1, args.Length ) ) { string arg = args[ 0 ]; if ( arg == "on" ) return true; else if ( arg == "off" ) return false; else { LogError( context, "Illegal '{0}' arg '{1}'; should be 'on' or 'off'", introducer, arg ); } } return false; }