本文整理汇总了C#中Func.ToFSharpFunc方法的典型用法代码示例。如果您正苦于以下问题:C# Func.ToFSharpFunc方法的具体用法?C# Func.ToFSharpFunc怎么用?C# Func.ToFSharpFunc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Func
的用法示例。
在下文中一共展示了Func.ToFSharpFunc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateLongCommand
internal static Command CreateLongCommand(string name, Func<FSharpOption<int>, Register, LongCommandResult> func, CommandFlags flags = CommandFlags.None)
{
var fsharpFunc = func.ToFSharpFunc();
var list = name.Select(KeyInputUtil.CharToKeyInput).ToFSharpList();
var commandName = KeyInputSet.NewManyKeyInputs(list);
return Command.NewLongCommand(commandName, flags, fsharpFunc);
}
示例2: CreateCommand
private CommandRunData CreateCommand(
Func<FSharpOption<int>, Register, CommandResult> func = null,
KeyInputSet name = null,
CommandFlags? flags = null,
int? count = 0,
MotionRunData motionRunData = null,
VisualSpan visualRunData = null)
{
name = name ?? KeyInputSet.NewOneKeyInput(KeyInputUtil.CharToKeyInput('c'));
var flagsRaw = flags ?? CommandFlags.None;
var countRaw = count.HasValue ? FSharpOption.Create(count.Value) : FSharpOption<int>.None;
var funcRaw = func.ToFSharpFunc();
var cmd = Command.NewSimpleCommand(
name,
flagsRaw,
func.ToFSharpFunc());
return new CommandRunData(
cmd,
new Register('c'),
countRaw,
motionRunData != null ? FSharpOption.Create(motionRunData) : FSharpOption<MotionRunData>.None,
visualRunData != null ? FSharpOption.Create(visualRunData) : FSharpOption<VisualSpan>.None);
}
示例3: CreateFunc
private FSharpFunc<Unit, ITagger<TextMarkerTag>> CreateFunc(Func<ITagger<TextMarkerTag>> func)
{
return func.ToFSharpFunc();
}
示例4: CreateVisualCommand
internal static Command CreateVisualCommand(
string name = "c",
CommandFlags? flags = null,
VisualKind kind = null,
Func<FSharpOption<int>, Register, VisualSpan, CommandResult> func = null)
{
var flagsArg = flags ?? CommandFlags.None;
kind = kind ?? VisualKind.Line;
if (func == null)
{
func = (x, y, z) => CommandResult.NewCompleted(ModeSwitch.NoSwitch);
}
return Command.NewVisualCommand(
KeyNotationUtil.StringToKeyInputSet(name),
flagsArg,
kind,
func.ToFSharpFunc());
}
示例5: Create
private CountedTagger<TextMarkerTag> Create(object key, PropertyCollection propertyCollection, Func<ITagger<TextMarkerTag>> func)
{
return Create(key, propertyCollection, func.ToFSharpFunc());
}