예제 #1
0
 public void TestButtons() {
     _button.Buttons( "a" );
     var result = new Str();
     result.Add( "title:'a'," );
     result.Add( "buttons:'a'" );
     Assert.AreEqual( CreateResult( result.ToString() ), _button.ToHtmlString() );
 }
예제 #2
0
 /// <summary>
 /// 渲染
 /// </summary>
 public string Render() {
     var result = new Str();
     result.Add( "[" );
     result.Add( _toolbar.GetItems().Splice() );
     result.Add( "]" );
     return result.ToString();
 }
예제 #3
0
 public void TestGetSql_Pager() {
     _builder.From( "t" ).SetPager( new Pager( 1, 20, "a" ) );
     var result = new Str();
     result.Add( "Select * From t " );
     result.Add( "Order By a Offset 0 Rows Fetch Next 20 Rows Only" );
     Assert.AreEqual( result.ToString(), _builder.GetSql() );
 }
예제 #4
0
 /// <summary>
 /// 验证结果
 /// </summary>
 private void AssertResult(string options = "",string html = "") {
     var result = new Str();
     result.Add( "<div class=\"web-uploader\" data-options=\"{0}\">", options );
     result.Add( html );
     result.Add( "</div>" );
     Assert.AreEqual( result.ToString(), _uploader.ToString() );
     
 }
예제 #5
0
파일: ComboxTest.cs 프로젝트: NetUtil/Util
 public void TestPanelHeight() {
     _combox.Add( "a" ).PanelHeight( "100" );
     var result = new Str();
     result.Add( "<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'100'\">" );
     result.Add( "<option>a</option>" );
     result.Add( "</select>" );
     Assert.AreEqual( result.ToString(), _combox.ToHtmlString() );
 }
예제 #6
0
        /// <summary>
        /// 获取基础选项
        /// </summary>
        private string GetBaseOptions()
        {
            var result = new Str();

            result.Add("title:'a',");
            result.Add("buttons:'dialogButtons',");
            return(result.ToString());
        }
예제 #7
0
 /// <summary>
 /// 创建输出结果
 /// </summary>
 private string CreateReuslt( string name, string options = null ) {
     var result = new Str();
     result.Add( "<input class=\"easyui-textbox\" name=\"{0}\"", name );
     if ( options.IsEmpty() == false )
         result.Add( " data-options=\"{0}\"", options );
     result.Add( "/>" );
     return result.ToString();
 }
예제 #8
0
 public void TestUrl_Value() {
     _tree.Id( "id1" ).Url( "a", "b" );
     var result = new Str();
     result.Add( "<select class=\"easyui-combotree\" id=\"id1\" lazyValue=\"b\" data-options=\"onLoadSuccess:$.easyui.setComboTreeLazyValue_onLoadSuccess('id1'),url:'a'\">" );
     result.Add( "</select>" );
     Console.WriteLine( result );
     Assert.AreEqual( result.ToString(), _tree.ToHtmlString() );
 }
예제 #9
0
 /// <summary>
 /// 获取结果
 /// </summary>
 private string GetResult( string options = "" ) {
     var result = new Str();
     result.Add( "<select class=\"easyui-combotree\"" );
     if ( !options.IsEmpty() )
         result.Add( " data-options=\"{0}\"", options );
     result.Add( "></select>" );
     return result.ToString();
 }
예제 #10
0
        /// <summary>
        /// 创建输出结果
        /// </summary>
        private string CreateResult(string name, string value)
        {
            var result = new Str();

            result.Add(GetBaseOptions());
            result.Add("{0}:{1}", name, value);
            return(CreateResult(result.ToString()));
        }
예제 #11
0
 /// <summary>
 /// 验证结果
 /// </summary>
 private void AssertResult( string options = "" ) {
     var result = new Str();
     result.Add( "<div class=\"easyui-pagination\"" );
     if( !options.IsEmpty() )
         result.Add( " data-options=\"{0}\"",options );
     result.Add( "></div>" );
     Assert.AreEqual( result.ToString(), _pagination.ToHtmlString() );
 }
예제 #12
0
        public void TestImportJs()
        {
            Str expected = new Str();

            expected.Add("<script type=\"text/javascript\" ");
            expected.Add("src=\"/Js/a.js\" />");
            Assert.AreEqual("<script type=\"text/javascript\" src=\"/Js/a.js\"></script>", _service.ImportJs("/Js/a.js").ToString());
        }
예제 #13
0
파일: JsonTest.cs 프로젝트: NetUtil/Util
 public void TestToObject() {
     Str result = new Str();
     result.Add( "{" );
     result.Add( "\"Name\":\"a\"" );
     result.Add( "}" );
     var customer = Json.ToObject<Customer>( result.ToString() );
     Assert.AreEqual( "a", customer.Name );
 }
예제 #14
0
 /// <summary>
 /// 获取脚本
 /// </summary>
 public static string GetButtonScript_1_2() {
     Str result = new Str();
     result.Add( "var toolbar = new Ext.Toolbar({\"id\":\"toolbar\"});" );
     result.Add( "toolbar.add(" );
     result.Add( "{\"text\":\"新建\",\"iconCls\":\"a\",\"handler\":showBox}" );
     result.Add( ");" );
     return result.ToString();
 }
예제 #15
0
        public void TestOnChange()
        {
            _combox.OnChange("a").OnChange("b");
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',onChange:$.easyui.textbox_onChange([a,b])\">");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #16
0
        public void TestHidden()
        {
            _combox.Hidden("a", "1");
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',onChange:$.easyui.textbox_onChange([$.easyui.setComboxHiddenText_onChange('a')])\"></select>");
            result.Add("<input type=\"hidden\" name=\"a\" value=\"1\"/>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #17
0
파일: TreeTest.cs 프로젝트: NetUtil/Util
 /// <summary>
 /// 获取结果
 /// </summary>
 private string GetResult( string options = "" ) {
     var result = new Str();
     result.Add( "<ul class=\"easyui-tree\"" );
     if( !options.IsEmpty() )
         result.Add( " data-options=\"{0}\"",options );
     result.Add( "></ul>" );
     Console.Write( result.ToString() );
     return result.ToString();
 }
예제 #18
0
        public void TestButtons()
        {
            _button.Buttons("a");
            var result = new Str();

            result.Add("title:'a',");
            result.Add("buttons:'a'");
            Assert.AreEqual(CreateResult(result.ToString()), _button.ToHtmlString());
        }
예제 #19
0
파일: ComboxTest.cs 프로젝트: NetUtil/Util
 public void TestAdd() {
     _combox.Add( "a" ).Add( "b", 2 ).Value( "2" );
     var result = new Str();
     result.Add( "<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto'\">" );
     result.Add( "<option>a</option>" );
     result.Add( "<option value=\"2\" selected=\"selected\">b</option>" );
     result.Add( "</select>" );
     Assert.AreEqual( result.ToString(), _combox.ToHtmlString() );
 }
예제 #20
0
 /// <summary>
 /// 创建输出结果
 /// </summary>
 private string CreateResult( string html ) {
     var result = new Str();
     result.Add( "<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" " );
     result.Add( "onClick=\"$.easyui.dialog({" );
     result.Add( html );
     result.Add( "})\"" );
     result.Add( ">a</a>" );
     return result.ToString();
 }
예제 #21
0
        public void TestLazyValue()
        {
            _combox.Id("id1").LazyValue("a");
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',onLoadSuccess:$.easyui.setComboxLazyValue_onLoadSuccess('id1')\" id=\"id1\" lazyValue=\"a\">");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #22
0
 /// <summary>
 /// 获取脚本
 /// </summary>
 public static string GetButtonScript_2() {
     Str result = new Str();
     result.Add( "var toolbar = new Ext.Toolbar({\"id\":\"toolbar\"});" );
     result.Add( "toolbar.add(" );
     result.Add( "{\"text\":\"新建\",\"handler\":new}," );
     result.Add( "{\"text\":\"修改\",\"handler\":update}" );
     result.Add( ");" );
     return result.ToString();
 }
예제 #23
0
 public void TestEnum_Nullable() {
     var combox = new EntityCombox<User, TestEnum?>( t => t.NullableEnumValue );
     var result = new Str();
     result.Add( "<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto'\" name=\"NullableEnumValue\">" );
     result.Add( "<option value=\"1\">A1</option>" );
     result.Add( "<option value=\"2\">B1</option>" );
     result.Add( "</select>" );
     Assert.AreEqual( result.ToString(), combox.ToHtmlString() );
 }
예제 #24
0
 public void TestBool_Nullable() {
     var combox = new EntityCombox<User, bool?>( t => t.NullableBoolValue );
     var result = new Str();
     result.Add( "<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',width:50\" name=\"NullableBoolValue\">" );
     result.Add( "<option value=\"false\">否</option>" );
     result.Add( "<option value=\"true\">是</option>" );
     result.Add( "</select>" );
     Assert.AreEqual( result.ToString(), combox.ToHtmlString() );
 }
예제 #25
0
        public void TestGetSql_Pager()
        {
            _builder.From("t").SetPager(new Pager(1, 20, "a"));
            var result = new Str();

            result.Add("With Temp As ( Select * , Row_Number() Over( Order By a ) as SortNumber From t ) ");
            result.Add("Select * From Temp Where SortNumber Between 1 and 20");
            Assert.AreEqual(result.ToString(), _builder.GetSql());
        }
예제 #26
0
파일: ComboxTest.cs 프로젝트: NetUtil/Util
 public void TestBool() {
     _combox.Bool();
     var result = new Str();
     result.Add( "<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',width:50\">" );
     result.Add( "<option value=\"false\">否</option>" );
     result.Add( "<option value=\"true\">是</option>" );
     result.Add( "</select>" );
     Assert.AreEqual( result.ToString(), _combox.ToHtmlString() );
 }
예제 #27
0
        public void TestDialogSize()
        {
            _button.DialogSize(100, 200);
            var result = new Str();

            result.Add(GetBaseOptions());
            result.Add("width:100,height:200");
            Assert.AreEqual(CreateResult(result.ToString()), _button.ToHtmlString());
        }
예제 #28
0
        public void TestGetSql_Pager()
        {
            _builder.From("t").SetPager(new Pager(1, 20, "a"));
            var result = new Str();

            result.Add("Select * From t ");
            result.Add("Order By a Offset 0 Rows Fetch Next 20 Rows Only");
            Assert.AreEqual(result.ToString(), _builder.GetSql());
        }
예제 #29
0
 public void TestButton_Render() {
     _toolbar.RenderTo( "div1" );
     _toolbar.Button( "新建", "new" );
     Str result = new Str();
     result.Add( "var toolbar = new Ext.Toolbar({\"id\":\"toolbar\",\"renderTo\":\"div1\"});" );
     result.Add( "toolbar.add(" );
     result.Add( "{\"text\":\"新建\",\"handler\":new}" );
     result.Add( ");" );
     Assert.AreEqual( result.ToString(), _toolbar.ToHtmlString() );
 }
예제 #30
0
        public void TestCloseDialog()
        {
            _button.CloseDialog();
            var result = new Str();

            result.Add("<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" ");
            result.Add("onClick=\"$.easyui.closeDialog()\"");
            result.Add(">a</a>");
            Assert.AreEqual(result.ToString(), _button.ToHtmlString());
        }
예제 #31
0
 public void Test_2Node_Children() {
     var node = new TreeNode { Id = "1", Text = "a",Level = 1};
     var node2 = new TreeNode { Id = "2", ParentId = "1", Text = "b", Level = 2 };
     _result = new TreeResult( new[] { node, node2 } );
     var expected = new Str();
     expected.Add( "[{\"id\":\"1\",\"text\":\"a\"," );
     expected.Add( "\"children\":[{\"id\":\"2\",\"ParentId\":\"1\",\"text\":\"b\"}]" );
     expected.Add( "}]" );
     Assert.AreEqual( expected.ToString(), _result.ToString() );
 }
예제 #32
0
 public void TestGetResult() {
     var list = Test2.CreateList();
     var result = new DataGridResult( list, 2 );
     var expected = new Str();
     expected.Add( "{\"total\":2,\"rows\":[" );
     expected.Add( "{\"Id\":1,\"Name\":\"a\",\"Description\":\"a\"}," );
     expected.Add( "{\"Id\":2,\"Name\":\"b\",\"Description\":\"b\"}" );
     expected.Add( "]}" );
     Assert.AreEqual( expected.ToString(),result.ToString() );
 }
예제 #33
0
 /// <summary>
 /// 获取输出结果
 /// </summary>
 protected string GetResult( string options = "",string text= "" ) {
     var result = new Str();
     result.Add( "<div " );
     if ( !options.IsEmpty() ) {
         result.Add( "data-options=\"{0}\"", options );
     }
     result.Add( ">{0}",text );
     result.Add( "</div>" );
     return result.ToString();
 }
예제 #34
0
        public void TestChild_Url()
        {
            _combox.Child("a", "b", "c");
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto'");
            result.Add(",onChange:$.easyui.textbox_onChange([$.easyui.setChildCombox_onChange('a','b','c')])\"");
            result.Add("></select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #35
0
        public void TestPanelHeight()
        {
            _combox.Add("a").PanelHeight("100");
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'100'\">");
            result.Add("<option>a</option>");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #36
0
        public void TestUrl_Value()
        {
            _tree.Id("id1").Url("a", "b");
            var result = new Str();

            result.Add("<select class=\"easyui-combotree\" id=\"id1\" lazyValue=\"b\" data-options=\"onLoadSuccess:$.easyui.setComboTreeLazyValue_onLoadSuccess('id1'),url:'a'\">");
            result.Add("</select>");
            Console.WriteLine(result);
            Assert.AreEqual(result.ToString(), _tree.ToHtmlString());
        }
예제 #37
0
        public void TestBool_Nullable()
        {
            var combox = new EntityCombox <User, bool?>(t => t.NullableBoolValue);
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',width:50\" name=\"NullableBoolValue\">");
            result.Add("<option value=\"false\">否</option>");
            result.Add("<option value=\"true\">是</option>");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), combox.ToHtmlString());
        }
예제 #38
0
        public void TestEnum_Nullable()
        {
            var combox = new EntityCombox <User, TestEnum?>(t => t.NullableEnumValue);
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto'\" name=\"NullableEnumValue\">");
            result.Add("<option value=\"1\">A1</option>");
            result.Add("<option value=\"2\">B1</option>");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), combox.ToHtmlString());
        }
예제 #39
0
        public void TestBool()
        {
            _combox.Bool();
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto',width:50\">");
            result.Add("<option value=\"false\">否</option>");
            result.Add("<option value=\"true\">是</option>");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #40
0
        /// <summary>
        /// 创建输出结果
        /// </summary>
        private string CreateResult(string html)
        {
            var result = new Str();

            result.Add("<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" ");
            result.Add("onClick=\"$.easyui.dialog({");
            result.Add(html);
            result.Add("})\"");
            result.Add(">a</a>");
            return(result.ToString());
        }
예제 #41
0
        public void TestAdd()
        {
            _combox.Add("a").Add("b", 2).Value("2");
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto'\">");
            result.Add("<option>a</option>");
            result.Add("<option value=\"2\" selected=\"selected\">b</option>");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #42
0
        public void TestToObject()
        {
            Str result = new Str();

            result.Add("{");
            result.Add("\"Name\":\"a\"");
            result.Add("}");
            var customer = Json.ToObject <Customer>(result.ToString());

            Assert.AreEqual("a", customer.Name);
        }
예제 #43
0
파일: MenuTest.cs 프로젝트: NetUtil/Util
 /// <summary>
 /// 获取输出结果
 /// </summary>
 protected string GetResult( string options = "",string items = "" ) {
     var result = new Str();
     result.Add( "<div id=\"a\" class=\"easyui-menu\"" );
     if ( !options.IsEmpty() )
         result.Add( " data-options=\"{0}\"", options );
     result.Add( ">" );
     if ( !items.IsEmpty() )
         result.Add( items );
     result.Add( "</div>" );
     return result.ToString();
 }
예제 #44
0
 /// <summary>
 /// 获取结果
 /// </summary>
 public static string GetResult( string option = "",string text = "" ) {
     var result = new Str();
     result.Add( "<th " );
     if( !option.IsEmpty() )
         result.Add( "data-options=\"{0}\"",option );
     result.Add( ">" );
     if( !text.IsEmpty() )
         result.Add( text );
     result.Add( "</th>" );
     return result.ToString();
 }
예제 #45
0
        public void TestEnum()
        {
            _combox.Enum <TestEnum>();
            var result = new Str();

            result.Add("<select class=\"easyui-combobox\" data-options=\"editable:false,panelHeight:'auto'\">");
            result.Add("<option value=\"1\">A1</option>");
            result.Add("<option value=\"2\">B1</option>");
            result.Add("</select>");
            Assert.AreEqual(result.ToString(), _combox.ToHtmlString());
        }
예제 #46
0
        /// <summary>
        /// 创建输出结果
        /// </summary>
        private string CreateReuslt(string options = null)
        {
            var result = new Str();

            result.Add("<input class=\"easyui-textbox\"");
            if (options.IsEmpty() == false)
            {
                result.Add(" data-options=\"{0}\"", options);
            }
            result.Add("/>");
            return(result.ToString());
        }
예제 #47
0
        public void TestGetResult()
        {
            var list     = Test2.CreateList();
            var result   = new DataGridResult(list, 2);
            var expected = new Str();

            expected.Add("{\"total\":2,\"rows\":[");
            expected.Add("{\"Id\":1,\"Name\":\"a\",\"Description\":\"a\"},");
            expected.Add("{\"Id\":2,\"Name\":\"b\",\"Description\":\"b\"}");
            expected.Add("]}");
            Assert.AreEqual(expected.ToString(), result.ToString());
        }
예제 #48
0
        /// <summary>
        /// 获取结果
        /// </summary>
        private string GetResult(string options = "")
        {
            var result = new Str();

            result.Add("<select class=\"easyui-combotree\"");
            if (!options.IsEmpty())
            {
                result.Add(" data-options=\"{0}\"", options);
            }
            result.Add("></select>");
            return(result.ToString());
        }
예제 #49
0
 public void Test_3Node_Children() {
     var node = new TreeNode { Id = "1" };
     var node2 = new TreeNode { Id = "2", ParentId = "1" };
     var node3 = new TreeNode { Id = "3", ParentId = "2" };
     _result = new TreeResult( new[] { node2, node3, node } );
     var expected = new Str();
     expected.Add( "[{\"id\":\"1\",\"children\":[" );
     expected.Add( "{\"id\":\"2\",\"ParentId\":\"1\",\"children\":[" );
     expected.Add( "{\"id\":\"3\",\"ParentId\":\"2\"}]" );
     expected.Add( "}]}]" );
     Assert.AreEqual( expected.ToString(), _result.ToString() );
 }
예제 #50
0
        /// <summary>
        /// 验证结果
        /// </summary>
        private void AssertResult(string options = "")
        {
            var result = new Str();

            result.Add("<div class=\"easyui-pagination\"");
            if (!options.IsEmpty())
            {
                result.Add(" data-options=\"{0}\"", options);
            }
            result.Add("></div>");
            Assert.AreEqual(result.ToString(), _pagination.ToHtmlString());
        }
예제 #51
0
        /// <summary>
        /// 获取输出结果
        /// </summary>
        protected string GetResult(string options = "", string text = "")
        {
            var result = new Str();

            result.Add("<div ");
            if (!options.IsEmpty())
            {
                result.Add("data-options=\"{0}\"", options);
            }
            result.Add(">{0}", text);
            result.Add("</div>");
            return(result.ToString());
        }
예제 #52
0
        public void TestPerformance_Clear()
        {
            Str str = new Str();

            str.Add("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            str.Add("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            str.Add("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            str.Add("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            for (int i = 0; i < 10000000; i++)
            {
                str.Clear();
            }
        }
예제 #53
0
        /// <summary>
        /// 获取结果
        /// </summary>
        private string GetResult(string options = "")
        {
            var result = new Str();

            result.Add("<ul class=\"easyui-tree\"");
            if (!options.IsEmpty())
            {
                result.Add(" data-options=\"{0}\"", options);
            }
            result.Add("></ul>");
            Console.Write(result.ToString());
            return(result.ToString());
        }
예제 #54
0
        public void TestAync_DataGridResult()
        {
            var node = new TreeNode {
                Id = "1", Text = "a"
            };

            _result = new TreeGridResult(new[] { node }, true, 1);
            var expected = new Str();

            expected.Add("{\"total\":1,\"rows\":[");
            expected.Add("{\"id\":\"1\",\"text\":\"a\",\"state\":\"closed\"}");
            expected.Add("]}");
            Assert.AreEqual(expected.ToString(), _result.ToString());
        }
예제 #55
0
        public void TestColumnEdit()
        {
            var column = new DataGridColumn();

            column.Edit();
            _grid.Columns(column);
            var result = new Str();

            result.Add("<table class=\"easyui-etreegrid\">");
            result.Add("<thead><tr>");
            result.Add(column.ToHtmlString());
            result.Add("</tr></thead>");
            result.Add("</table>");
            Assert.AreEqual(result.ToString(), _grid.ToHtmlString());
        }
예제 #56
0
파일: ButtonTest.cs 프로젝트: NetUtil/Util
 /// <summary>
 /// 创建输出结果
 /// </summary>
 private string CreateResult( string options = "",string @class = "") {
     if ( !options.IsEmpty() )
         options = " " + options;
     var result = new Str();
     result.Add( "<a href=\"javascript:void(0)\" class=\"easyui-linkbutton{0}\"{1}>a</a>", GetClass( @class ), options );
     return result.ToString();
 }
예제 #57
0
 /// <summary>
 /// 获取输出结果,设置标题为A,设置内容为B,回调为C
 /// </summary>
 public static string GetResult_TitleA_ContentB_CallbackC() {
     Str result = new Str();
     result.Add( "Ext.Msg.show({" );
     result.Add( "\"title\":\"a\"," );
     result.Add( "\"msg\":\"b\"," );
     result.Add( "\"buttons\":Ext.MessageBox.OK," );
     result.Add( "\"fn\":c," );
     result.Add( "\"closable\":true," );
     result.Add( "\"modal\":true," );
     result.Add( "\"icon\":Ext.MessageBox.INFO" );
     result.Add( "});" );
     return result.ToString();
 }
예제 #58
0
파일: JsonTest.cs 프로젝트: NetUtil/Util
 public void TestToJson() {
     Str result = new Str();
     result.Add( "{" );
     result.Add( "\"Name\":\"a\"," );
     result.Add( "\"nickname\":\"b\"," );
     result.Add( "\"func\":c," );
     result.Add( "\"Value\":null," );
     result.Add( "\"Date\":\"2012/1/1 0:00:00\"," );
     result.Add( "\"Age\":1," );
     result.Add( "\"isShow\":true" );
     result.Add( "}" );
     Console.Write( result );
     Assert.AreEqual( result.ToString(), Json.ToJson( Customer.Create() ) ); 
 }
예제 #59
0
 /// <summary>
 /// 获取结果
 /// </summary>
 public static string GetResult_All() {
     Str result = new Str();
     result.Add( "Ext.Msg.show({" );
     result.Add( "\"title\":\"a\"," );
     result.Add( "\"msg\":\"b\"," );
     result.Add( "\"width\":100," );
     result.Add( "\"buttons\":Ext.MessageBox.YESNOCANCEL," );
     result.Add( "\"fn\":c," );
     result.Add( "\"animEl\":\"div1\"," );
     result.Add( "\"closable\":false," );
     result.Add( "\"modal\":false," );
     result.Add( "\"prompt\":true," );
     result.Add( "\"multiline\":true," );
     result.Add( "\"icon\":Ext.MessageBox.ERROR," );
     result.Add( "\"value\":\"d\"" );
     result.Add( "});" );
     return result.ToString();
 }
예제 #60
0
 /// <summary>
 /// 获取修改进度条内容结果
 /// </summary>
 public static string GetResult_Content() {
     Str result = new Str();
     result.Add( "Ext.Msg.show({" );
     result.Add( "wait: true," );
     result.Add( "draggable: false," );
     result.Add( "width: 300," );
     result.Add( "progressText: \"请稍候..\"," );
     result.Add( "msg: \"\"," );
     result.Add( "icon: \"progress-Save\"" );
     result.Add( "});" );
     return result.ToString();
 }