本文整理汇总了C#中IEnvironment.CreateBool方法的典型用法代码示例。如果您正苦于以下问题:C# IEnvironment.CreateBool方法的具体用法?C# IEnvironment.CreateBool怎么用?C# IEnvironment.CreateBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnvironment
的用法示例。
在下文中一共展示了IEnvironment.CreateBool方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public IJsValue Delete(IEnvironment environment)
{
var obj = Instance.Evaluate(environment);
return environment.CreateBool(obj
.Cast<IJsObject>("Cannot convert {0} to object", obj)
.DeleteProperty(Member.Evaluate(environment).ToString()));
}
示例2: RelationalEval
public static IJsValue RelationalEval(IEnvironment environment, IJsValue lhs, IJsValue rhs,
Func<double, double, bool> relationalOperator,
Func<string, string, bool> stringRelationalOperator)
{
if ((lhs.ToPrimitive() is string) || (rhs.ToPrimitive() is string))
{
return environment.CreateBool(stringRelationalOperator(lhs.ToString(), rhs.ToString()));
}
var ln = lhs.ToNumber();
if (double.IsNaN(ln))
{
return JsUndefined.Value;
}
var rn = rhs.ToNumber();
if (double.IsNaN(rn))
{
return JsUndefined.Value;
}
return environment.CreateBool(relationalOperator(ln, rn));
}
示例3: Evaluate
public IJsValue Evaluate(IEnvironment environment)
{
return environment.CreateBool(Value);
}
示例4: Delete
public IJsValue Delete(IEnvironment environment)
{
//throw new JsReferenceError();
// We end up here when deleting a scope variable, which isnt supported
return environment.CreateBool(false);
}