Ejemplo n.º 1
0
        /// <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();*/
        }