AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

AdvantageAttributeControl..::..SafeBool Method

Safely converts an object to a boolean value, returning the default if the object is null.

Namespace:  AdvantageCMS.Core.Common.BaseClasses
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public bool SafeBool(
	Object obj,
	bool defaultValue
)

Parameters

obj
Type: Object
The object to convert.
defaultValue
Type: Boolean
The default value to return if obj is null.

Return Value

The boolean value of the object, or defaultValue if the object is null.