当前位置: 首页>>代码示例>>C#>>正文


C# Layer.Read方法代码示例

本文整理汇总了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;
//.........这里部分代码省略.........
开发者ID:OpiWerner,项目名称:weView,代码行数:101,代码来源:Foil.cs


注:本文中的Layer.Read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。