本文整理汇总了C#中System.CodeDom.CodeTypeDeclaration.Dump方法的典型用法代码示例。如果您正苦于以下问题:C# CodeTypeDeclaration.Dump方法的具体用法?C# CodeTypeDeclaration.Dump怎么用?C# CodeTypeDeclaration.Dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.CodeDom.CodeTypeDeclaration
的用法示例。
在下文中一共展示了CodeTypeDeclaration.Dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test
/// <summary>
/// Tests this instance.
/// </summary>
/// <returns>the dumped object </returns>
public string Test()
{
//var element = "My String".ToCharArray().AsQueryable();
var element = "My String".ToCharArray().Select(e => new { e, Depp = (uint)e }).AsQueryable();
element.Dump(2);
/*ConstantExpression blockExpr = Expression.Constant(
Expression.Constant(42)
);
blockExpr.Dump(2);*/
// TestXmlSeria();
var testObject = new CodeTypeDeclaration("DeclClass");
var method = new CodeMemberMethod { Name = "MyMethod" };
testObject.Members.Add(method);
var method2 = new CodeMemberMethod { Name = "OtherMethod" };
testObject.Members.Add(method2);
var comment = new CodeCommentStatement("This is a comment");
method.Statements.Add(comment);
var prop = new CodeMemberProperty { Name = "MyProperty", Type = new CodeTypeReference(typeof(string)) };
testObject.Members.Add(prop);
testObject.Dump("The description", 5);
// var res = Extensions.Text;
return string.Empty;
/* var ms = new MemoryStream();
var writer = new StreamWriter(ms);
var swriter = new StringWriter();
ObjectDumper.Write(testObject, int.MaxValue, swriter);
//var xx = ms.ToString();
var result = swriter.ToString();*/
}