本文整理汇总了C#中System.IO.TextWriter.CheckParameterForNull方法的典型用法代码示例。如果您正苦于以下问题:C# TextWriter.CheckParameterForNull方法的具体用法?C# TextWriter.CheckParameterForNull怎么用?C# TextWriter.CheckParameterForNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.TextWriter
的用法示例。
在下文中一共展示了TextWriter.CheckParameterForNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Print
/// <summary>
/// Prints the contents of <paramref name="this"/> to the given <see cref="TextWriter"/>.
/// </summary>
/// <param name="this">The <see cref="Exception"/> to print.</param>
/// <param name="writer">The <see cref="TextWriter"/> to write exception information to.</param>
/// <exception cref="ArgumentNullException">
/// Thrown if either <paramref name="this"/> or <paramref name="writer"/> is <c>null</c>.
/// </exception>
public static void Print(this Exception @this, TextWriter writer)
{
@this.CheckParameterForNull("@this");
writer.CheckParameterForNull("writer");
writer.WriteLine("Type Name: {0}", @this.GetType().FullName);
#if !SILVERLIGHT
writer.WriteLine("\tSource: {0}", @this.Source);
writer.WriteLine("\tTargetSite: {0}",
ExceptionExtensions.FormatMethod(@this.TargetSite));
#endif
writer.WriteLine("\tMessage: {0}", @this.Message);
#if !SILVERLIGHT
writer.WriteLine("\tHelpLink: {0}", @this.HelpLink);
#endif
@this.PrintCustomProperties(writer);
@this.PrintStackTrace(writer);
@this.PrintData(writer);
if (@this.InnerException != null)
{
writer.WriteLine();
@this.InnerException.Print(writer);
}
}