Esempio n. 1
0
        public void SandBox2()
        {
            string[] rwhtmls = new string[] {
            @"<rw:ContentControl>
            <rw:TextBox Text=""Hello Redwood!"" />
            </rw:ContentControl>",

            @"<rw:ContentControl>
            <rw:TextBox>
            <rw:TextBox.Text>Hello Redwood!</rw:TextBox.Text>
            </rw:TextBox>
            </rw:ContentControl>",

            @"<rw:ContentControl>
            <rw:ContentControl.Content>
            <rw:TextBox Text=""Hello Redwood!"" />
            </rw:ContentControl.Content>
            </rw:ContentControl>" };

            var serializer = new RwHtmlSerializer();
            foreach (var rwhtml in rwhtmls)
            {
                var result = (ContentControl)serializer.LoadFromString(rwhtml);

                Assert.IsInstanceOfType(result.Content, typeof(TextBox));
                Assert.AreEqual("Hello Redwood!", ((TextBox)result.Content).Text);
            }
        }
Esempio n. 2
0
        //[TestMethod]
        public void SandBox1()
        {
            string rwhtml = @"<html><rw:TextBox Text=""Hello!""  Mode=""Password"" /><rw:ContentControl /><aaa xmlns:aaa=""clr-namespace:Redwood.Framework.Controls;assembly=Redwood.Framework""><aaa.Prop1>Něco</aaa.Prop1><aaa:ContentControl></aaa:ContentControl></aaa></html>";

            rwhtml = @"
            <rw:Container Layout.Source=""~/Views/Layout.rwhtml"" xmlns:my=""clr-namespace:MyAssembly;assembly=MyAssembly"">
              <my:CustomLayout.Something>SomethingElse</my:CustomLayout.Something>
              <div class=""inside-container"">
            <my:CustomTableControl Title=""My Table"">
              Hello Redwood!
              <my:CustomTableControl.RowTemplate>
            <div>{RawBinding Content}</div>
              </my:CustomTableControl.RowTemplate>
            </my:CustomTableControl>
              </div>
            </rw:Container>
            ";

            //rwhtml = new System.Net.WebClient().DownloadString("http://www.dotnetportal.cz/");

            var serializer = new RwHtmlSerializer();
            serializer.LoadFromString(rwhtml);

            //Debug.WriteLine("----------------");
        }
Esempio n. 3
0
        public void SandBox3()
        {
            string rwhtml =
            @"<rw:ContentControl>
            <div class=""form"">
            <ul>
            <li>
                <rw:TextBox Text=""Hello Redwood!"" />
            </li>
            </ul>
            </div>
            </rw:ContentControl>";
            rwhtml = new System.Net.WebClient().DownloadString("http://www.dotnetportal.cz/");

            rwhtml = "<rw:ContentControl>" + rwhtml + "</rw:ContentControl>";

            var serializer = new RwHtmlSerializer();
            var result = (ContentControl)serializer.LoadFromString(rwhtml);
            var writer = new Generation.HtmlWriter();
            result.Render(writer);
            var str = writer.ToString();
        }
Esempio n. 4
0
 public void BuildControlTreeFromRwhtml1()
 {
     string rwhtml = @"<html><rw:TextBox Text=""Hello!""  Mode=""Password"" /><rw:ContentControl /><aaa xmlns:aaa=""clr-namespace:Redwood.Framework.Controls;assembly=Redwood.Framework""><aaa:ContentControl></aaa:ContentControl></aaa></html>";
     var serializer = new RwHtmlSerializer();
     var result = serializer.LoadFromString(rwhtml);
 }
Esempio n. 5
0
 public void SandBox4()
 {
     string rwhtml =
     @"<html>
         <head>
             <title>{Title}</title>
         </head>
         <body>
             <rw:ContentControl />
         </body>
     </html>";
     var serializer = new RwHtmlSerializer();
     var result = (HtmlElement)serializer.LoadFromString(rwhtml);
 }