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


C# Spine.AddItemRef方法代码示例

本文整理汇总了C#中Spine.AddItemRef方法的典型用法代码示例。如果您正苦于以下问题:C# Spine.AddItemRef方法的具体用法?C# Spine.AddItemRef怎么用?C# Spine.AddItemRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Spine的用法示例。


在下文中一共展示了Spine.AddItemRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Button_Click

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Package p = new Package();
            p.unique_identifier = "boo";
            p.version = "1";
            Manifest manifest = new Manifest();
            manifest.AddItem(new Item("id1",".\\test.html","application/xhtml+xml", null));
            manifest.AddItem(new Item("id2", ".\\test.html", "application/xhtml+xml", null));
            manifest.AddItem(new Item("toc", txtNcxFile.Text, "application/x-dtbncx+xml", null));
            p.myManifest = manifest;

            Metadata metadata = new Metadata();
            p.myMetadata = metadata;
            metadata.title = "My title";

            Spine s = new Spine("ncx");
            s.AddItemRef(new ItemRef("id11","yes"));
            s.AddItemRef(new ItemRef("id12","yes"));
            p.mySpine = s;

            Guide g = new Guide();
            g.AddReference(new Reference("toc", "title",txtNcxFile.Text));
            g.AddReference(new Reference("toc1", "title2", ".//ref.html"));

            p.myGuide = g;

            TextWriter tw = serialise(p);
            txtPackage.Text = tw.ToString();

            tw.Close();

            NavigationCentereXtended ncx = new NavigationCentereXtended();
            ncx.myDocAuthor = new DocAuthor("John h author");
            ncx.myDocTitle = new DocTitle("My Book..");

            ncx.myNavList.AddNavTarget(new NavTarget(new NavLabel("Nav Label 1"), new Content("content.html")));
            ncx.myNavList.AddNavTarget(new NavTarget(new NavLabel("Nav Label 2"), new Content("content2.html")));
            ncx.myNavMap.AddNavPoint(new NavPoint(1, "id1", "point class", new NavLabel("Nav Label 1"), new Content("srctext")));
            ncx.myNavMap.AddNavPoint(new NavPoint(1, "id1", "point class2 ", new NavLabel("Nav Label 2"), new Content("srctext")));

            ncx.myNcxHead = new NcxHead();
            ncx.myNcxHead.myMeta = new Meta("content", "name");

            ncx.myPageList.AddPageTarget(new PageTarget("id1", "type", "value", new NavLabel("txtLabel"), new Content("src1")));
            ncx.myPageList.AddPageTarget(new PageTarget("id2", "type", "value", new NavLabel("txtLabel2"), new Content("src2")));

            TextWriter tw2 = serialise(ncx);
            txtNcx.Text = tw2.ToString();
            tw2.Close();
        }
开发者ID:bijeshnath,项目名称:ebookwriter,代码行数:50,代码来源:MainWindow.xaml.cs


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