本文整理汇总了C#中Layer.Read方法的典型用法代码示例。如果您正苦于以下问题:C# Layer.Read方法的具体用法?C# Layer.Read怎么用?C# Layer.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layer
的用法示例。
在下文中一共展示了Layer.Read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read(XmlReader xR)
{
// ------------------------------------------------------------
WERROR.writeLog(ClassName + ".Read Folie: " + FoilNr);
while (xR.Read()) {
if (xR.NodeType == XmlNodeType.EndElement) break;
if (xR.NodeType == XmlNodeType.Element) {
switch (xR.Name) {
case "foilname": if (xR.MoveToContent() != XmlNodeType.None) FoilName = xR.ReadString(); break;
case "duration": if (xR.MoveToContent() != XmlNodeType.None) {
DurationSec = Convert.ToInt32(xR.ReadString());
if (DurationSec == WCONST.NONUMBER) DurationSec = 0;
}
break;
case "delay": if (xR.MoveToContent() != XmlNodeType.None) {
Delay = Convert.ToInt32(xR.ReadString());
if (Delay == WCONST.NONUMBER) Delay = 0;
}
break;
case "speachtime": if (xR.MoveToContent() != XmlNodeType.None) {
SpeachTime = Convert.ToInt32(xR.ReadString());
if (SpeachTime == WCONST.NONUMBER) SpeachTime = 0;
}
break;
case "noticefile": if (xR.MoveToContent() != XmlNodeType.None) { String dummy = xR.ReadString(); } break;
case "note":
if (xR.MoveToContent() != XmlNodeType.None) {
String note = xR.ReadString();
if (note == WCONST.UNKNOWN) note = " ";
RichTextBox rtb = new RichTextBox();
WRICHTEXT.SetTextAndFonts(note, rtb, FoilsNoteFont);
NoteRtf = WRICHTEXT.RtfToString(rtb.Document);
}
break;
case "notertf": xR.Read(); if (xR.MoveToContent() == XmlNodeType.CDATA) { NoteRtf = xR.ReadString(); } break;
case "handouttext":
if (xR.MoveToContent() != XmlNodeType.None) {
String note = xR.ReadString();
if (note == WCONST.UNKNOWN) note = " ";
RichTextBox rtb = new RichTextBox();
WRICHTEXT.SetTextAndFonts(note, rtb, HandoutNoteFont);
HandoutNoteRtf = WRICHTEXT.RtfToString(rtb.Document);
}
break;
case "notekeys": if (xR.MoveToContent() != XmlNodeType.None) { String dummy = xR.ReadString(); } break;
case "notematerial": if (xR.MoveToContent() != XmlNodeType.None) { String dummy = xR.ReadString(); } break;
case "handoutfile": if (xR.MoveToContent() != XmlNodeType.None) { String dummy = xR.ReadString(); } break;
case "handoutnotertf": xR.Read(); if (xR.MoveToContent() == XmlNodeType.CDATA) { HandoutNoteRtf = xR.ReadString(); } break;
// Folientext
case "foilsfont": FoilsFont.ReadFont(xR); break;
case "foilstext": FoilsFont.ReadText(xR); break;
// Foliennotizen
case "foilsnotefont": FoilsNoteFont.ReadFont(xR); break;
case "foilsnotetext": FoilsNoteFont.ReadText(xR); break;
// Handout
case "handoutnotefont": HandoutNoteFont.ReadFont(xR); break;
case "handoutnotetext": HandoutNoteFont.ReadText(xR); break;
case "active": if (xR.MoveToContent() != XmlNodeType.None) Active = Convert.ToBoolean(xR.ReadString()); break;
case "isshowlegend": if (xR.MoveToContent() != XmlNodeType.None) IsShowLegend = Convert.ToBoolean(xR.ReadString()); break;
case "autoplay": if (xR.MoveToContent() != XmlNodeType.None) AutoPlay = Convert.ToBoolean(xR.ReadString()); break;
case "isprintable": if (xR.MoveToContent() != XmlNodeType.None) IsPrintable = Convert.ToBoolean(xR.ReadString()); break;
case "isprintfoils": if (xR.MoveToContent() != XmlNodeType.None) IsPrintFoils = Convert.ToBoolean(xR.ReadString()); break;
case "isprintnotes": if (xR.MoveToContent() != XmlNodeType.None) IsPrintNotes = Convert.ToBoolean(xR.ReadString()); break;
case "isprinthandouts": if (xR.MoveToContent() != XmlNodeType.None) IsPrintHandouts = Convert.ToBoolean(xR.ReadString()); break;
case "layer":
Layer tmpLayer = new Layer();
tmpLayer.LayNr = Layers.Count;
tmpLayer.Read(xR);
tmpLayer.ChangeLayerName();
// rtf-Text in Text umwandeln
if (WSGLOBAL.ActShow.ShowKind != "book" && tmpLayer.LayText == null) {
if (tmpLayer.LayKind == "rtftext") {
FlowDocument fd = WRICHTEXT.StringToRtf(tmpLayer.LayRtfText);
TextRange ttr = new TextRange(fd.ContentStart, fd.ContentEnd);
tmpLayer.LayText = ttr.Text;
tmpLayer.LayKind = "text";
}
}
Layers.Add(tmpLayer);
break;
case "properties":
Active = false; IsShowLegend = false; AutoPlay = false;
if (xR.MoveToContent() != XmlNodeType.None) {
if (xR.HasAttributes) {
while (xR.MoveToNextAttribute()) {
switch (xR.Name) {
case "duration": DurationSec = Convert.ToInt32(xR.Value);
if (DurationSec == WCONST.NONUMBER) DurationSec = 0;
break;
case "delay": Delay = Convert.ToInt32(xR.Value);
if (Delay == WCONST.NONUMBER) Delay = 0;
break;
case "speachtime": SpeachTime = Convert.ToInt32(xR.Value);
if (SpeachTime == WCONST.NONUMBER) SpeachTime = 0;
break;
//.........这里部分代码省略.........