本文整理汇总了C#中FSharpList.Select方法的典型用法代码示例。如果您正苦于以下问题:C# FSharpList.Select方法的具体用法?C# FSharpList.Select怎么用?C# FSharpList.Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSharpList
的用法示例。
在下文中一共展示了FSharpList.Select方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: __eval_internal
protected virtual void __eval_internal(FSharpList<FScheme.Value> args, Dictionary<PortData, FScheme.Value> outPuts)
{
var t = GetType();
if (t != typeof(Watch) && !typeof(MathBase).IsAssignableFrom(t) )
{
args = Utils.ToFSharpList(args.Select(SIUnit.UnwrapToDoubleWithHostUnitConversion));
}
_errorCount = 0;
__eval_internal_recursive(args, outPuts);
if (_errorCount > 1)
Error(string.Format("{0} runs generated errors.\n\n{1}", _errorCount, ToolTipText));
}
示例2: Evaluate
public override Value Evaluate(FSharpList<Value> args)
{
var e = new Expression(Formula);
var functionLookup = new Dictionary<string, Value>();
foreach (var arg in args.Select((arg, i) => new { Value = arg, Index = i }))
{
var parameter = InPortData[arg.Index].NickName;
if (arg.Value.IsFunction)
functionLookup[parameter] = arg.Value;
else
e.Parameters[parameter] = ((Value.Number)arg.Value).Item;
}
e.EvaluateFunction += delegate(string name, FunctionArgs fArgs)
{
if (functionLookup.ContainsKey(name))
{
var func = ((Value.Function)functionLookup[name]).Item;
fArgs.Result = ((Value.Number)func.Invoke(
Utils.SequenceToFSharpList(
fArgs.Parameters.Select<Expression, Value>(
p => Value.NewNumber(Convert.ToDouble(p.Evaluate())))))).Item;
}
else
{
fArgs.HasResult = false;
}
};
return Value.NewNumber(Convert.ToDouble(e.Evaluate()));
}
示例3: __eval_internal
protected internal virtual void __eval_internal(FSharpList<Value> args, Dictionary<PortData, Value> outPuts)
{
var argList = new List<string>();
if (args.Count() > 0)
{
argList = args.Select(x => x.ToString()).ToList<string>();
}
var outPutsList = new List<string>();
if(outPuts.Count() > 0)
{
outPutsList = outPuts.Keys.Select(x=>x.NickName).ToList<string>();
}
Debug.WriteLine(string.Format("__eval_internal : {0} : {1}",
string.Join(",", argList),
string.Join(",", outPutsList)));
Evaluate(args, outPuts);
}
示例4: Evaluate
public override Value Evaluate(FSharpList<Value> args)
{
var e = new Expression(FormulaString.ToLower(), EvaluateOptions.IgnoreCase);
e.Parameters["pi"] = 3.14159265358979;
var functionLookup = new Dictionary<string, Value>();
foreach (var arg in args.Select((arg, i) => new { Value = arg, Index = i }))
{
var parameter = InPortData[arg.Index].NickName;
if (arg.Value.IsFunction)
functionLookup[parameter] = arg.Value;
else
{
if (arg.Value.IsNumber)
{
e.Parameters[parameter] = ((Value.Number)arg.Value).Item;
}
else if (arg.Value.IsContainer)
{
e.Parameters[parameter] = SIUnit.UnwrapToSIUnit(arg.Value).Value * dynSettings.Controller.UnitsManager.UiLengthConversion;
}
}
}
e.EvaluateFunction += delegate(string name, FunctionArgs fArgs)
{
if (functionLookup.ContainsKey(name))
{
var func = ((Value.Function)functionLookup[name]).Item;
fArgs.Result = ((Value.Number)func.Invoke(
Utils.ToFSharpList(
fArgs.Parameters.Select(
p => Value.NewNumber(Convert.ToDouble(p.Evaluate())))))).Item;
}
else
{
fArgs.HasResult = false;
}
};
return Value.NewNumber(Convert.ToDouble(e.Evaluate()));
}
示例5: __eval_internal
protected virtual void __eval_internal(FSharpList<FScheme.Value> args, Dictionary<PortData, FScheme.Value> outPuts)
{
//HACK: This allows us to apply a host units conversion for all
//types in the DynamoRevit library
if (GetType().Assembly.GetName().Name == "DynamoRevit")
{
args = args.Select(Utils.UnwrapToDoubleWithHostUnitConversion).ToFSharpList();
}
_errorCount = 0;
__eval_internal_recursive(args, outPuts);
if (_errorCount > 1)
Error(string.Format("{0} runs generated errors.\n\n{1}", _errorCount, ToolTipText));
}
示例6: Evaluate
public override Expression Evaluate(FSharpList<Expression> args)
{
var procedure = this.Bench.Environment.LookupSymbol(this.Symbol);
if (procedure.IsFunction)
{
return (procedure as Expression.Function).Item
.Invoke(ExecutionEnvironment.IDENT)
.Invoke(
Utils.convertSequence(
args.Select(
input => this.macroEnvironment.Evaluate(input)
)
)
);
}
else
return base.Evaluate(args);
}
示例7: evalIfDirty
private Expression evalIfDirty(FSharpList<Expression> args, ExecutionEnvironment environment)
{
//If this node requires a re-calc or if we haven't calc'd yet...
if (this.IsDirty || this.oldValue == null)
{
//Store the environment
this.macroEnvironment = environment;
//Evaluate arguments, then evaluate this.
this.oldValue = this.eval(
Utils.convertSequence(
args.Select(
input => environment.Evaluate(input)
)
)
);
}
else //Otherwise, just increment the run counter.
this.runCount++;
//We're done here
return this.oldValue;
}