當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。