本文整理汇总了C#中IOutput.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# IOutput.WriteLine方法的具体用法?C# IOutput.WriteLine怎么用?C# IOutput.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOutput
的用法示例。
在下文中一共展示了IOutput.WriteLine方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RaceModule
public RaceModule(IRaceData raceDataStream, IOutput output)
{
Before += ctx => {
String message = String.Format("{0} : [Host: {1}] {2}",
DateTime.Now,
ctx.Request.UserHostAddress,
ctx.Request.Url.ToString());
output.WriteLine(message);
String token = ctx.Request.Headers["X-Hamstring-Token"].SingleOrDefault();
if (token == null || token.Trim() != SERVICE_TOKEN) {
output.WriteLine("=== ACCESS DENIED ===");
return HttpStatusCode.Forbidden;
}
return ctx.Response;
};
Get["/races"] = routeParameters => {
var races = raceDataStream.UpcomingRaces();
return Response.AsJson(races);
};
After += ctx => {
//http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
ctx.Response.Headers.Add("X-Powered-By", "HamstringFX.RaceService");
ctx.Response.Headers.Add("X-Version", "1.0");
};
}
示例2: Format
public void Format(IOutput output, CommandMapper commandMapper, IEnumerable<IParameterMapper> mappers,
ICommandParameterParser parser)
{
foreach (var line in this.Format(commandMapper, mappers, parser))
{
output.WriteLine(line);
}
}
示例3: ExportTo
public void ExportTo(IOutput output)
{
foreach (string prefix in GetPrefixes())
{
output.WriteLine(prefix);
}
foreach (IExportable child in GetChildren())
{
child.ExportTo(output);
}
foreach (string suffix in GetSuffixes())
{
output.WriteLine(suffix);
}
}
示例4: DumpStatistics
public static void DumpStatistics(IOutput output)
{
if (PreconditionInferenceProfiler.totalMethodsWithPreconditons <= 0)
return;
output.WriteLine("Methods with necessary preconditions: {0}", new object[1]
{
(object) PreconditionInferenceProfiler.totalMethodsWithPreconditons
});
if (PreconditionInferenceProfiler.totalMethodsWithNecessaryPreconditions > -1)
output.WriteLine("Methods where preconditions were also sufficient: {0}", new object[1]
{
(object) (PreconditionInferenceProfiler.totalMethodsWithNecessaryPreconditions + 1)
});
if (PreconditionInferenceProfiler.inferred <= 0)
return;
output.WriteLine("Discovered {0} new candidate preconditions in {1}", (object) PreconditionInferenceProfiler.inferred, (object) PreconditionInferenceProfiler.inferenceTime);
}
示例5: DumpStatistics
public static void DumpStatistics(IOutput output)
{
Contract.Requires(output != null);
output.WriteLine("Inferred {0} object invariants", generated);
output.WriteLine("Retained {0} object invariants after filtering", retained);
}
示例6: DumpStatistics
public static void DumpStatistics(IOutput output)
{
Contract.Requires(output != null);
if (generated != 0)
{
output.WriteLine("Discovered {0} postconditions to suggest", generated);
output.WriteLine("Retained {0} postconditions after filtering", retained);
}
}
示例7: DumpStatistics
public static void DumpStatistics(IOutput output)
{
Contract.Requires(output != null);
if (generated != 0)
{
output.WriteLine("Detected {0} preconditions for base methods to suggest", generated);
}
}
示例8: DumpStatistics
public static void DumpStatistics(IOutput output)
{
Contract.Requires(output != null);
if (entryAssumeStatistics.Generated != 0)
{
output.WriteLine("Generated {0} entry assume(s) (suggested {1} after filtering)", entryAssumeStatistics.Generated, entryAssumeStatistics.Retained);
}
if (calleeAssumeStatistics.Generated != 0)
{
output.WriteLine("Generated {0} callee assume(s) ", calleeAssumeStatistics.Generated,
calleeAssumeStatistics.Retained > 0 ? string.Format("suggested {0} after filtering", calleeAssumeStatistics.Retained) : String.Empty);
}
}