当前位置: 首页>>代码示例>>C#>>正文


C# IOutput.WriteLine方法代码示例

本文整理汇总了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");
              };
        }
开发者ID:nicholascloud,项目名称:presentations,代码行数:30,代码来源:RaceModule.cs

示例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);
     }
 }
开发者ID:Cologler,项目名称:Jasily.Framework.ConsoleEngine,代码行数:8,代码来源:ParametersFormater.cs

示例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);
            }
        }
开发者ID:Phazyck,项目名称:CsvToYnab,代码行数:17,代码来源:AComplexExportable.cs

示例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);
        }
开发者ID:mono-soc-2012,项目名称:code-contracts-oleg,代码行数:20,代码来源:PreconditionInferenceProfiler.cs

示例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);
    }
开发者ID:nbulp,项目名称:CodeContracts,代码行数:7,代码来源:ObjectInvariants.cs

示例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);
      }
    }
开发者ID:nbulp,项目名称:CodeContracts,代码行数:10,代码来源:Postconditions.cs

示例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);
            }
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:9,代码来源:OverriddenPreconditions.cs

示例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);
            }
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:14,代码来源:Assume.cs


注:本文中的IOutput.WriteLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。