本文整理汇总了C#中ScriptProcessor.CreateBool方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptProcessor.CreateBool方法的具体用法?C# ScriptProcessor.CreateBool怎么用?C# ScriptProcessor.CreateBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptProcessor
的用法示例。
在下文中一共展示了ScriptProcessor.CreateBool方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToBool
internal override SBool ToBool(ScriptProcessor processor)
{
return processor.CreateBool(Value != 0);
}
示例2: Includes
public static SObject Includes(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
{
if (parameters.Length >= 1)
{
var str = instance as SString;
var includes = parameters[0].ToString(processor);
return processor.CreateBool(str.Value.Contains(includes.Value));
}
return processor.Undefined;
}
示例3: ToBool
internal override SBool ToBool(ScriptProcessor processor)
{
return processor.CreateBool(false);
}
示例4: StartsWith
public static SObject StartsWith(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
{
if (TypeContract.Ensure(parameters, typeof(SString)))
{
var str = instance as SString;
var includes = parameters[0] as SString;
if (includes.Value == "")
return processor.CreateBool(str.Value == "");
return processor.CreateBool(str.Value.StartsWith(includes.Value));
}
return processor.Undefined;
}
示例5: TranslateBool
private static SObject TranslateBool(ScriptProcessor processor, bool boolIn)
{
return processor.CreateBool(boolIn);
}
示例6: Includes
public static SObject Includes(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
{
if (parameters.Length == 1)
{
var arr = (SArray)instance;
var compare = parameters[0];
return processor.CreateBool(arr.ArrayMembers.Any(m => ObjectComparer.LooseEquals(processor, m, compare)));
}
if (parameters.Length >= 2)
{
var arr = (SArray)instance;
var compare = parameters[0];
var comparer = (SFunction)Unbox(parameters[1]);
return processor.CreateBool(arr.ArrayMembers.Any(m => ((SBool)comparer.Call(processor, This, This, new[] { m, compare })).Value));
}
return processor.Undefined;
}
示例7: All
public static SObject All(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
{
if (parameters.Length >= 1)
{
var arr = (SArray)instance;
var comparer = (SFunction)Unbox(parameters[0]);
var result = arr.ArrayMembers.All(m => ((SBool)comparer.Call(processor, This, This, new[] { m })).Value);
return processor.CreateBool(result);
}
return processor.Undefined;
}
示例8: ToBool
/// <summary>
/// Returns the bool representation of this object.
/// </summary>
internal virtual SBool ToBool(ScriptProcessor processor)
{
return processor.CreateBool(true);
}