本文整理汇总了C#中Arguments.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Arguments.ToString方法的具体用法?C# Arguments.ToString怎么用?C# Arguments.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arguments
的用法示例。
在下文中一共展示了Arguments.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: run
public virtual ExitCode run(Arguments arguments)
{
var status = compile();
if (status != 0) return -1;
Func<String> readArguments = () => inferArguments() ?? Console.readln(prompt: "Run arguments", history: String.Format("run {0}", file.FullName));
return Console.interactive(exe.FullName.GetShortPath() + " " + (arguments.Count > 0 ? arguments.ToString() : readArguments()), home: dir);
}
示例2: run
public virtual ExitCode run(Arguments arguments)
{
Func<String> readArguments = () => Console.readln(prompt: "Run arguments", history: String.Format("run {0}", file.FullName));
return Console.interactive(file.FullName.GetShortPath() + " " + (arguments.Count > 0 ? arguments.ToString() : readArguments()), home: dir);
}
示例3: run
public virtual ExitCode run(Arguments arguments)
{
var info = compileAndInfer();
if (info == null) return -1;
String mainclass = null;
if (info.mainclasses.Count() == 0) {
Console.println("error: no main classes have been detected");
return -1;
} else if (info.mainclasses.Count() == 1) {
mainclass = info.mainclasses[0];
} else {
Console.println("Please, select one of the detected mainclasses: {0} or {1}", String.Join(", ", info.mainclasses.Take(info.mainclasses.Count() - 1)), info.mainclasses[info.mainclasses.Count() - 1]);
Func<String> readMainclass = () => Console.readln(prompt: "Mainclass", history: String.Format("mainclass {0}", root.FullName));
mainclass = readMainclass();
if (mainclass == String.Empty) {
Console.println("error: mainclass cannot be empty");
return -1;
}
}
var scala = (info.scalahome + "\\bin\\scala.bat").GetShortPath();
var options = new List<String>();
options.Add("-deprecation");
options.Add("-classpath " + String.Join(";", info.classpath.Select(path => path.GetShortPath())));
options.Add(mainclass);
Func<String> readArguments = () => Console.readln(prompt: "Run arguments", history: String.Format("run {0}", root.FullName));
options.Add(arguments.Count > 0 ? arguments.ToString() : readArguments());
return Console.interactive(scala + " " + String.Join(" ", options.ToArray()), home: sbtroot);
}