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


C# TextWriter.GetType方法代码示例

本文整理汇总了C#中System.IO.TextWriter.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# TextWriter.GetType方法的具体用法?C# TextWriter.GetType怎么用?C# TextWriter.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.TextWriter的用法示例。


在下文中一共展示了TextWriter.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

 public static TextWriterOriginator Create(TextWriter writer)
 {
     if (writer is SpoolWriter)
         return new SpoolWriterOriginator((SpoolWriter) writer);
     if (writer is StringWriter)
         return new StringWriterOriginator((StringWriter)writer);
     throw new InvalidCastException("writer is unknown type " + writer.GetType().FullName);
 }
开发者ID:ronniebarker,项目名称:spark,代码行数:8,代码来源:TextWriterOriginator.cs

示例2: ClosePrintStream

 public void ClosePrintStream(
     TextWriter printStream)
 {
     if (printStream.GetType().ToString() == typeof(StreamWriter).ToString())
     {
         var streamWriter = (StreamWriter) printStream;
         streamWriter.Close();
     }
 }
开发者ID:linus123,项目名称:dbdeploy-net,代码行数:9,代码来源:PrintScreenFactory.cs

示例3: ContextInfo

 public static IHtmlString ContextInfo(TextWriter writer)
 {
     var res = new StringBuilder();
     res.AppendLine("<pre style='margin:10px'>");
     res.AppendLine("TextWriter");
     res.AppendLine("Type: {0}", writer.GetType().Name);
     res.AppendLine("TextWriter.GetHashCode:{0}", writer.GetHashCode());
     res.AppendLine("TextWriter.ToString:{0}", writer.ToString());
     res.AppendLine("</pre>");
     return new MvcHtmlString(res.ToString());
 }
开发者ID:Mvc-UpdatePanel,项目名称:Mvc.UpdatePanel,代码行数:11,代码来源:Utils.cs

示例4: GetEncodedWriter

 private static TextWriter GetEncodedWriter(TextWriter writer)
 {
     if(typeof(EncodedTextWriter).IsAssignableFrom(writer.GetType()))
     {
         return writer;
     }
     else
     {
         return new EncodedTextWriter(writer);
     }
 }
开发者ID:lukasz-lysik,项目名称:Handlebars.Net,代码行数:11,代码来源:ContextBinder.cs

示例5: GetUnencodedWriter

 private static TextWriter GetUnencodedWriter(TextWriter writer)
 {
     if (typeof(EncodedTextWriter).IsAssignableFrom(writer.GetType()))
     {
         return ((EncodedTextWriter)writer).UnderlyingWriter;
     }
     else
     {
         return writer;
     }
 }
开发者ID:fedeneo77,项目名称:Handlebars.Net,代码行数:11,代码来源:BindingContext.cs


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