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


C# Chapter类代码示例

本文整理汇总了C#中Chapter的典型用法代码示例。如果您正苦于以下问题:C# Chapter类的具体用法?C# Chapter怎么用?C# Chapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Page

        internal Page(Chapter a_chapter, string a_url, int a_index, ulong a_id, string a_name, byte[] a_hash, 
            string a_image_file_path, PageState a_state) : base(a_id)
        {
            Hash = a_hash;
            ImageFilePath = a_image_file_path;
            m_state = a_state;

            Chapter = a_chapter;
            URL = HtmlDecode(a_url);
            Index = a_index;

            if (State == PageState.Downloading)
                m_state = PageState.Initial;
            if (State == PageState.Waiting)
                m_state = PageState.Initial;

            if (a_name != "")
            {
                a_name = a_name.Trim();
                a_name = a_name.Replace("\t", " ");
                while (a_name.IndexOf("  ") != -1)
                    a_name = a_name.Replace("  ", " ");
                a_name = HtmlDecode(a_name);
                Name = FileUtils.RemoveInvalidFileCharacters(a_name);
            }
            else
                Name = Index.ToString();
        }
开发者ID:KebinuChiousu,项目名称:MangaCrawler,代码行数:28,代码来源:Page.cs

示例2: DownloadPages

        internal override IEnumerable<Page> DownloadPages(Chapter a_chapter)
        {
            HtmlDocument doc = DownloadDocument(a_chapter);

            var pages = doc.DocumentNode.SelectNodes("//select[@name='pagejump']/option");

            var result = new List<Page>();

            int index = 0;
            foreach (var page in pages)
            {
                index++;

                string link = a_chapter.URL;
                int page_index = link.LastIndexOf("/page");
                link = link.Left(page_index + 5);
                link += page.GetAttributeValue("Value", "") + ".html";

                Page pi = new Page(a_chapter, link, index, "");

                result.Add(pi);
            }

            if (result.Count == 0)
                throw new Exception("Chapter has no pages");

            return result;
        }
开发者ID:KebinuChiousu,项目名称:MangaCrawler,代码行数:28,代码来源:MangaShareCrawler.cs

示例3: ddlChapters_DataBound

 protected void ddlChapters_DataBound(object sender, EventArgs e)
 {
     //get right chapter by ID taken from ddlChapters.SelectedValue
     chap = chap.GetById(new Guid(ddlChapters.SelectedValue));
     //call loadChapterContent
     loadChapterContent(chap.Title, chap.ChapterContent);
 }
开发者ID:bwaites,项目名称:fanatafics,代码行数:7,代码来源:EditChapters.aspx.cs

示例4: DownloadPages

        internal override IEnumerable<Page> DownloadPages(Chapter a_chapter)
        {
            HtmlDocument doc = DownloadDocument(a_chapter);

            List<Page> result = new List<Page>();

            var top_center_bar = doc.DocumentNode.SelectSingleNode("//div[@id='top_center_bar']");
            var pages = top_center_bar.SelectNodes("div[@class='r m']/div[@class='l']/select[@class='m']/option");

            int index = 1;

            foreach (var page in pages)
            {
                if (page.NextSibling != null)
                {
                    if (page.NextSibling.InnerText == "Comments")
                        continue;
                }

                Page pi = new Page(
                    a_chapter,
                    a_chapter.URL.Replace("1.html", String.Format("{0}.html", page.GetAttributeValue("value", ""))), 
                    index, 
                    "");

                index++;

                result.Add(pi);
            }

            if (result.Count == 0)
                throw new Exception("Chapter has no pages");

            return result;
        }
开发者ID:KebinuChiousu,项目名称:MangaCrawler,代码行数:35,代码来源:MangaFoxCrawler.cs

示例5: GetChapters

        public IEnumerable<IChapter> GetChapters()
        {
            List<Chapter> retVal = new List<Chapter>();
            string content = Utility.GetContent(url);

            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(content);

            doc.DocumentNode.SelectNodes("//table[@id=\"listing\"]//tr")
                .Skip(1)
                .ToList()
                .ForEach(ch =>
                {
                    Chapter chapter = new Chapter
                    {
                        Number = getNumber(ch),
                        Title = getName(ch),
                        Uri = getUrl(ch)
                    };

                    retVal.Add(chapter);
                });

            return retVal;
        }
开发者ID:vgdagpin,项目名称:MangaAPI,代码行数:25,代码来源:MangaReader.cs

示例6: TrajectorySubParser_

 public TrajectorySubParser_(Chapter chapter, Scene scene)
     : base(chapter)
 {
     this.trajectory = new Trajectory();
     //scene.setTrajectory(trajectory);
     this.scene = scene;
 }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:7,代码来源:TrajectorySubParser_.cs

示例7: Init

    // Use this for initialization
    public override void Init()
    {
        go = GameObject.Find("Pinball(Clone)");

        if(go == null)
        {
            go = GameObject.Instantiate(Resources.Load("Prefabs/States/Pinball")) as GameObject;

            thisChapter = StateChapterSelect.Instance.Chapters[ID];
            m_PinballMono = go.GetComponent<PinballMono>();

            for (int i = 0; i < m_PinballMono.Levels.Length; i++)
            {
                m_PinballMono.Levels[i].SetActive(i == StateChapterSelect.Instance.Chapters[ID].LevelNumber);
            }

            if(thisChapter.Completed) return;

            if(ID == 0)
            {
                SetBucketPositions();
            }
            else
            {
                RandomizeBucketPosition();
            }

            m_PinballMono.SetFrameParent(true);
            m_PinballMono.SetCannonState(true);

        }
    }
开发者ID:PaulElmo,项目名称:Listen_In-Backup-,代码行数:33,代码来源:StatePinball.cs

示例8: Page

        internal Page(Chapter a_chapter, string url, int index, ulong id, string name, byte[] hash, 
            string imageFilePath, PageState pageState) : base(id)
        {
            Hash = hash;
            ImageFilePath = imageFilePath;
            _pageState = pageState;

            Chapter = a_chapter;
            URL = HtmlDecode(url);
            Index = index;

            if (State == PageState.Downloading)
                _pageState = PageState.Initial;
            if (State == PageState.Waiting)
                _pageState = PageState.Initial;

            if (name != "")
            {
                name = name.Trim();
                name = name.Replace("\t", " ");
                while (name.IndexOf("  ") != -1)
                    name = name.Replace("  ", " ");
                name = HtmlDecode(name);
                Name = FileUtils.RemoveInvalidFileCharacters(name);
            }
            else
                Name = Index.ToString();
        }
开发者ID:tundy,项目名称:MangaCrawler,代码行数:28,代码来源:Page.cs

示例9: Add

        public Chapter Add(Chapter chapterToAdd)
        {
            this.chapterRepository.Add(chapterToAdd);
            this.chapterRepository.Save();

            return chapterToAdd;
        }
开发者ID:newmast,项目名称:Steep,代码行数:7,代码来源:ChapterService.cs

示例10: GetPages

 internal override IPage[] GetPages(Chapter chapter, string mangaPageHtml)
 {
     var document = Parser.Parse(mangaPageHtml);
     var listNode = document.QuerySelectorAll("ul.dropdown-menu")[2];
     var linksNodes = listNode.QuerySelectorAll("a");
     var output = linksNodes.Select((d, e) => new Page(chapter, new Uri(d.Attributes["href"].Value), e + 1)).ToArray();
     return output;
 }
开发者ID:albertofustinoni,项目名称:MangaScrapeLib,代码行数:8,代码来源:MangaStreamRepository.cs

示例11: AddShouldBeAbleToAddChapter

 public void AddShouldBeAbleToAddChapter()
 {
     Chapter chapter = new Chapter() { Title = "Chapter 1", Duration = TimeSpan.FromSeconds(30) };
     this.list.Add(chapter);
     Assert.AreEqual(1, this.list.Count);
     Assert.AreEqual("Chapter 1", this.list[0].Title);
     Assert.AreEqual(TimeSpan.FromSeconds(30), this.list[0].Duration);
     Assert.AreEqual(chapter, this.list[0]);
 }
开发者ID:TorMueller,项目名称:knuckleball,代码行数:9,代码来源:ChapterListTests.cs

示例12: Add

        internal void Add(Chapter a_chapter)
        {
            if (m_downloading.Contains(a_chapter))
                return;

            var copy = m_downloading.ToList();
            copy.Add(a_chapter);
            m_downloading = copy;
        }
开发者ID:KebinuChiousu,项目名称:MangaCrawler,代码行数:9,代码来源:Downloading.cs

示例13: GetPages

        internal override IPage[] GetPages(Chapter chapter, string mangaPageHtml)
        {
            var document = Parser.Parse(mangaPageHtml);

            var selectNode = document.QuerySelector("select#pageSelect");
            var options = selectNode.QuerySelectorAll("option");
            var output = options.Select((d, e) => new Page(chapter, new Uri(RootUri, d.Attributes["value"].Value), e + 1)).ToArray();
            return output;
        }
开发者ID:albertofustinoni,项目名称:MangaScrapeLib,代码行数:9,代码来源:MangaEdenRepository.cs

示例14: Add

        internal void Add(Chapter chapter)
        {
            if (_downloading.Contains(chapter))
                return;

            var copy = _downloading.ToList();
            copy.Add(chapter);
            _downloading = copy;
        }
开发者ID:tundy,项目名称:MangaCrawler,代码行数:9,代码来源:Downloading.cs

示例15: GetPages

        internal override IPage[] GetPages(Chapter Chapter, string MangaPageHtml)
        {
            var Document = Parser.Parse(MangaPageHtml);

            var Node = Document.QuerySelector("#pages");
            var Nodes = Node.QuerySelectorAll("option");

            var Output = Nodes.Select((d, e) => new Page(Chapter, new Uri(RootUri, d.Attributes["value"].Value), e + 1)).OrderBy(d => d.PageNo);
            return Output.ToArray();
        }
开发者ID:albertofustinoni,项目名称:MangaScrapeLib,代码行数:10,代码来源:EatMangaRepository.cs


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