-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathTextItem.cs
72 lines (60 loc) · 1.28 KB
/
TextItem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Xml;
using System.Diagnostics;
using DigitalPlatform.Text;
namespace DigitalPlatform.Xml
{
// 文本节点
public class TextItem : Item
{
public TextItem()
{
}
internal TextItem(XmlEditor document)
{
this.Name = "#text";
this.m_document = document;
}
// parameters:
// style 暂不使用.
public override int Initial(XmlNode node,
ItemAllocator allocator,
object style,
bool bConnect)
{
this.Name = node.Name;
if (node.Value != null)
{
this.SetValue(node.Value);
}
else
{
Debug.Assert(false,"node节点的Value竟然为null");
}
return 0;
}
// parameters:
// style 初始化风格。暂未使用。
public override void InitialVisualSpecial(Box boxTotal)
{
XmlText text = new XmlText ();
text.Name = "TextOfTextItem";
text.container = boxTotal;
Debug.Assert(this.m_paraValue1 != null,"初始值不能为null");
text.Text = this.GetValue(); //this.m_paraValue;;
boxTotal.AddChildVisual(text);
this.m_paraValue1 = null;
/*
if (this.parent .ReadOnly == true
|| this.ReadOnly == true)
{
text.Editable = false;
}
*/
}
internal override string GetOuterXml(ElementItem FragmentRoot)
{
return StringUtil.GetXmlStringSimple(this.GetValue());
}
}
}