Scriban.Helpers.ScriptTimeSpan.IScriptCustomType C# (CSharp) Method

IScriptCustomType() private method

private IScriptCustomType ( Type destinationType, object &outValue ) : bool
destinationType System.Type
outValue object
return bool
        bool IScriptCustomType.TryConvertTo(Type destinationType, out object outValue)
        {
            outValue = null;
            if (destinationType == typeof (bool))
            {
                outValue = value != TimeSpan.Zero;
                return true;
            }

            if (destinationType == typeof (double))
            {
                outValue = value.TotalDays;
                return true;
            }

            return false;
        }

Same methods

ScriptTimeSpan::IScriptCustomType ( ScriptBinaryExpression expression, object left, object right ) : object
ScriptTimeSpan::IScriptCustomType ( ScriptUnaryExpression expression ) : object