Scriban.Helpers.ScriptTimeSpan.IScriptCustomType C# (CSharp) 메소드

IScriptCustomType() 개인적인 메소드

private IScriptCustomType ( Type destinationType, object &outValue ) : bool
destinationType System.Type
outValue object
리턴 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