本文整理汇总了C#中IScope.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IScope.Write方法的具体用法?C# IScope.Write怎么用?C# IScope.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScope
的用法示例。
在下文中一共展示了IScope.Write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunNesting
public static void RunNesting(int nil, IScope scope)
{
scope.Write(RuleLevel.None, "None1");
using (var child = scope.Create("Group1"))
{
child.Write(RuleLevel.Warn, "Warn1");
using (var grand = child.Create("Group2"))
{
grand.Write(RuleLevel.None, "None2");
grand.Error("Error1");
}
child.Write(RuleLevel.None, "None3");
}
scope.Write(RuleLevel.None, "None4");
}
示例2: Raise
public static void Raise(IScope scope, RuleLevel ruleLevel, string message)
{
switch (ruleLevel)
{
case RuleLevel.None:
scope.Write(RuleLevel.Warn, message);
break;
case RuleLevel.Warn:
case RuleLevel.Error:
scope.Write(RuleLevel.Error, message);
break;
default:
throw new ArgumentOutOfRangeException("level");
}
}