Nexus.Client.Games.Steam.KeyValue.AsBoolean C# (CSharp) Method

AsBoolean() public method

Attempts to convert and return the value of this instance as a boolean. If the conversion is invalid, the default value is returned.
public AsBoolean ( bool defaultValue ) : bool
defaultValue bool The default value to return if the conversion is invalid.
return bool
		public bool AsBoolean(bool defaultValue)
		{
			int value;

			if (int.TryParse(Value, out value) == false)
			{
				return defaultValue;
			}

			return value != 0;
		}