Renamed TextContent to Text
This commit is contained in:
parent
ab5a1b7829
commit
91516ebd65
|
@ -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 ?? ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
22
Ooui/Text.cs
22
Ooui/Text.cs
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 ();
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Tests
|
|||
public void DefaultCtor ()
|
||||
{
|
||||
var b = new Button ();
|
||||
Assert.AreEqual ("", b.TextContent);
|
||||
Assert.AreEqual ("", b.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue