Renamed TextContent to Text

This commit is contained in:
Frank A. Krueger 2017-06-13 21:17:50 -07:00
parent ab5a1b7829
commit 91516ebd65
5 changed files with 27 additions and 27 deletions

View File

@ -21,10 +21,10 @@ namespace Ooui
.Concat (from c in children from m in c.AllMessages select m)
.OrderBy (x => x.Id);
public string TextContent {
get { return String.Join ("", from c in children select c.TextContent); }
public virtual string Text {
get { return String.Join ("", from c in children select c.Text); }
set {
ReplaceAll (new Text (value ?? ""));
ReplaceAll (new TextNode (value ?? ""));
}
}

View File

@ -1,22 +0,0 @@
using System;
namespace Ooui
{
public class Text : Node
{
string data = "";
public string Data {
get => data;
set => SetProperty (ref data, value ?? "", "data");
}
public Text ()
{
}
public Text (string text)
{
Data = text;
}
}
}

22
Ooui/TextNode.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
namespace Ooui
{
public class TextNode : Node
{
string text = "";
public override string Text {
get => text;
set => SetProperty (ref text, value ?? "", "data");
}
public TextNode ()
{
}
public TextNode (string text)
{
Text = text;
}
}
}

View File

@ -12,7 +12,7 @@ namespace Samples
Title = "The best button",
Name = "TestButton",
Value = "Click Me",
TextContent = "I am a button, click me!"
Text = "I am a button, click me!"
};
server.Publish ("/button", button);
server.RunAsync ("http://*:8080/").Wait ();

View File

@ -12,7 +12,7 @@ namespace Tests
public void DefaultCtor ()
{
var b = new Button ();
Assert.AreEqual ("", b.TextContent);
Assert.AreEqual ("", b.Text);
}
}
}