public ActionResult DeleteConfirmed(int id) { AltName altName = db.AltNames.Find(id); db.AltNames.Remove(altName); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AltNameId,CutId,AltName1")] AltName altName) { if (ModelState.IsValid) { db.Entry(altName).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CutId = new SelectList(db.CutNames, "CutId", "CutName1", altName.CutId); return(View(altName)); }
public ActionResult Create([Bind(Include = "AltNameId,CutId,AltName1")] AltName altName) { if (ModelState.IsValid) { db.AltNames.Add(altName); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CutId = new SelectList(db.CutNames, "CutId", "CutName1", altName.CutId); return(View(altName)); }
internal override void Export(string table) { var vals = new List <object> { Id, Name.DBExport(), AltName.DBExport(), SiteType }; Database.ExportWorldItem(table, vals); }
/// <summary> Standardkonstruktor() /// <para>wird von allen anderen Konstruktoren aufgerufen</para> /// </summary> /// . /// <remarks> /// <para> Programmierer : Michael Pütz</para> /// Version : 0 /// <para> Unterversion : 1</para> /// Revision : 1 /// <para> letzteBearbeitung: 2016-12-17 13:29:11</para> /// <para> ersteBearbeitung : 2016-12-17 13:29:11</para> /// . /// <para> getestet am : </para> /// </remarks> public Anz_Intervall_Objekt() { InitializeComponent(); gp_Name.setName("Intervall : "); AltName.setName("alternativer Name:"); BasisIntervall.setName("Basis-Intervall : "); ID.setName("ID : "); IntervallID.setName("IntervallID : "); Typ.setName("Typ : "); ShowDialog(); }
// GET: AltName/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AltName altName = db.AltNames.Find(id); if (altName == null) { return(HttpNotFound()); } return(View(altName)); }
// GET: AltName/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AltName altName = db.AltNames.Find(id); if (altName == null) { return(HttpNotFound()); } ViewBag.CutId = new SelectList(db.CutNames, "CutId", "CutName1", altName.CutId); return(View(altName)); }
/// <summary> Konstruktor(methode,Intervall-Objekt) /// <para></para> /// </summary> /// <param name="methode">aufrufende Methode, TYP: STRING</param> /// <param name="objekt">Intervall-Objekt, TYP: ds_Intervall</param> /// . /// <remarks> /// <para> Programmierer : Michael Pütz</para> /// Version : 0 /// <para> Unterversion : 1</para> /// Revision : 1 /// <para> letzteBearbeitung: 2016-12-17 13:30:15</para> /// <para> ersteBearbeitung : 2016-12-17 13:30:15</para> /// . /// <para> getestet am : </para> /// </remarks> public Anz_Intervall_Objekt(string methode, ds_Intervall objekt) : this() { lbl_Methode.Text = methode; string _name = objekt.Name; string _altName = objekt.AltName; string _intervallName = objekt.IntervallName; string _altIntervallName = objekt.AltIntervallName; string _basisIntervall = objekt.BasisIntervall.ToString(); string _intervallID = objekt.IntervallID.ToString(); string _id = objekt.ID.ToString(); string _typ = objekt.Typ.ToString(); // -------------------------------------------------------- gp_Name.setData(_name); AltName.setData(_altName); BasisIntervall.setData(_basisIntervall); IntervallID.setData(_intervallID); ID.setData(_id); Typ.setData(_typ); ShowDialog(); }
internal override void Export(string table) { var vals = new List <object> { Id, Name.DBExport(), AltName.DBExport(), Parent.DBExport() }; Database.ExportWorldItem(table, vals); if (Coords != null) { var coordId = 0; foreach (var coord in Coords) { Database.ExportWorldItem("River_Coords", new List <object> { Id, coordId, coord.X, coord.Y }); coordId++; } } if (Elevation != null) { var elevationId = 0; foreach (var elevation in Elevation) { Database.ExportWorldItem("River_Elevation", new List <object> { Id, elevationId, elevation }); elevationId++; } } }
public MangaObject ParseMangaObject(string Content) { HtmlDocument MangaObjectDocument = new HtmlDocument(); MangaObjectDocument.LoadHtml(Content); HtmlNode MangaNode = MangaObjectDocument.DocumentNode.SelectSingleNode(".//section[contains(@class, 'manga')]"); String Name = HtmlEntity.DeEntitize(MangaNode.SelectSingleNode(".//div/div[1]/h1/a").InnerText); Name = Name.Substring(0, Name.LastIndexOf(' ')); HtmlNode AlternateNamesNode = MangaNode.SelectSingleNode(".//div/table/tr/td[2]/table/tr[4]/td"); List <String> AlternateNames = (from AltName in HtmlEntity.DeEntitize(AlternateNamesNode.InnerText).Split(';') select AltName.Trim()).ToList(); List <String> Authors = (from Node in MangaNode.SelectNodes(".//div/table/tr/td[2]/table/tr[5]/td/a") select HtmlEntity.DeEntitize(Node.InnerText)).ToList(); List <String> Artists = (from Node in MangaNode.SelectNodes(".//div/table/tr/td[2]/table/tr[6]/td/a") select HtmlEntity.DeEntitize(Node.InnerText)).ToList(); List <String> Genres = (from Node in MangaNode.SelectNodes(".//div/table/tr/td[2]/table/tr[7]/td/a") select HtmlEntity.DeEntitize(Node.InnerText)).ToList(); // Detect type MangaObjectType MangaType = MangaObjectType.Unknown; String mType = MangaNode.SelectSingleNode(".//div/table/tr/td[2]/table/tr[8]/td").InnerText.ToLower(); if (mType.Contains("japanese manga")) { MangaType = MangaObjectType.Manga; } else if (mType.Contains("korean manhwa")) { MangaType = MangaObjectType.Manhwa; } // Get description String Description = HtmlEntity.DeEntitize(MangaNode.SelectSingleNode(".//div/p").InnerText); // Chapters List <ChapterObject> Chapters = new List <ChapterObject>(); foreach (HtmlNode ChapterVersionNode in MangaNode.SelectNodes(".//*[@id='list']/div[starts-with(@id, 'stream_')]")) { foreach (HtmlNode VolumeNode in ChapterVersionNode.SelectNodes(".//div[contains(@class, 'volume')]")) { UInt32 Volume = 0; HtmlNode VolumeNameNode = VolumeNode.SelectSingleNode(".//h4"); if (!Equals(VolumeNameNode, null)) { String[] idParts = VolumeNameNode.GetAttributeValue("id", "v-1-").Split('-'); UInt32.TryParse(idParts[2], out Volume); } foreach (HtmlNode ChapterNode in ChapterVersionNode.SelectNodes(".//div/ul/li")) { HtmlNode InfoNode = ChapterNode.SelectSingleNode(".//a"); String ChapterName = HtmlEntity.DeEntitize(InfoNode.InnerText), Url = InfoNode.GetAttributeValue("href", null); UInt32 Chapter = 0, SubChapter = 0; Match match = Regex.Match(ChapterName, @"(vol\.(?<Volume>\d+)\s)?ch\.(?<Chapter>\d+)(\.(?<SubChapter>\d+))?"); if (match.Success) { if (match.Groups["Volume"].Success) { UInt32.TryParse(match.Groups["Volume"].Value, out Volume); } if (match.Groups["Chapter"].Success) { UInt32.TryParse(match.Groups["Chapter"].Value, out Chapter); } if (match.Groups["SubChapter"].Success) { UInt32.TryParse(match.Groups["SubChapter"].Value, out SubChapter); } } if (Equals(Url, null)) { continue; } Url = String.Format("{0}{1}", ExtensionDescriptionAttribute.RootUrl, Url); ChapterObject NewChapterObject = new ChapterObject() { Name = ChapterName, Volume = Volume, Chapter = Chapter, SubChapter = SubChapter, Locations = { new LocationObject() { Enabled = true, ExtensionName = ExtensionDescriptionAttribute.Name, ExtensionLanguage = ExtensionDescriptionAttribute.Language, Url = Url } } }; ChapterObject ExistingChapterObject = Chapters.FirstOrDefault(o => { if (!Int32.Equals(o.Chapter, NewChapterObject.Chapter)) { return(false); } if (!Int32.Equals(o.SubChapter, NewChapterObject.SubChapter)) { return(false); } return(true); }); if (Equals(ExistingChapterObject, null)) { Chapters.Add(NewChapterObject); } else { ExistingChapterObject.Merge(NewChapterObject); } } } } Chapters = Chapters.OrderBy(c => c.Chapter).ThenBy(c => c.SubChapter).ThenBy(c => c.Volume).ToList(); return(new MangaObject() { Name = Name, AlternateNames = AlternateNames, Description = Description, Authors = Authors, Artists = Artists, Genres = Genres, MangaType = MangaType, Chapters = Chapters }); }
public MangaObject ParseMangaObject(String content) { Int32 MangaInformationContentStart = content.IndexOf("<!-- Intro Series -->"), MangaInformationContentEnd = content.IndexOf("<!-- **END: Intro Series -->", MangaInformationContentStart); String MangaInformationContent = content.Substring(MangaInformationContentStart, MangaInformationContentEnd - MangaInformationContentStart); Int32 MangaChaptersContentStart = content.IndexOf("<!-- Main Content -->"), MangaChaptersContentEnd = content.IndexOf("<!-- **END: Main Content -->", MangaChaptersContentStart); String MangaChaptersContent = content.Substring(MangaChaptersContentStart, MangaChaptersContentEnd - MangaChaptersContentStart); HtmlDocument MangaObjectDocument = new HtmlDocument(); MangaObjectDocument.LoadHtml(MangaInformationContent); HtmlNode MangaObjectNode = MangaObjectDocument.DocumentNode.SelectSingleNode(".//div/div"); String MangaName = String.Empty, Description = String.Empty; List <String> AlternateNames = new List <String>(), AuthorsArtists = new List <String>(), Genres = new List <String>(); foreach (HtmlNode DetailNode in MangaObjectNode.SelectNodes(".//div[2]/div[contains(@class,'row')]")) { HtmlNode DetailTypeNode = DetailNode.SelectSingleNode(".//div[1]/b[1] | .//div[1]/strong[1]"), DetailTextNode = (DetailTypeNode != null) ? DetailTypeNode.NextSibling : null, DetailDescriptionNode = (DetailTextNode != null) ? DetailTextNode.NextSibling : null, MangaNameNode = DetailNode.SelectSingleNode(".//div[1]/h1"); HtmlNodeCollection DetailLinkNodes = DetailNode.SelectNodes(".//div[1]/a"); String DetailType = (DetailTypeNode != null) ? DetailTypeNode.InnerText.Trim().TrimEnd(':') : "MangaName", DetailValue = String.Empty; String[] DetailValues = { }; if (DetailLinkNodes != null) { DetailValues = (from HtmlNode LinkNode in DetailLinkNodes select HtmlEntity.DeEntitize(LinkNode.InnerText.Trim())).ToArray(); } else if (MangaNameNode != null) { DetailValue = HtmlEntity.DeEntitize(MangaNameNode.InnerText.Trim()); } else if (DetailDescriptionNode != null) { DetailValue = HtmlEntity.DeEntitize(DetailDescriptionNode.InnerText.Trim()); } else if (DetailTextNode != null) { DetailValue = HtmlEntity.DeEntitize(DetailTextNode.InnerText.Trim()); } switch (DetailType) { default: break; case "MangaName": MangaName = DetailValue; break; case "Alternate Names": AlternateNames = (from String AltName in DetailValue.Split(',') select HtmlEntity.DeEntitize(AltName.Trim())).ToList(); break; case "Author": AuthorsArtists = DetailValues.ToList(); break; case "Genre": Genres = DetailValues.ToList(); break; case "Description": Description = DetailValue; break; } } String Cover = ExtensionDescriptionAttribute.RootUrl + MangaObjectNode.SelectSingleNode(".//div[1]/img/@src").Attributes["src"].Value; List <ChapterObject> Chapters = new List <ChapterObject>(); MangaObjectDocument.LoadHtml(MangaChaptersContent); HtmlNodeCollection RawChapterList = MangaObjectDocument.DocumentNode.SelectNodes(".//div[contains(@class,'row')]"); foreach (HtmlNode RawChapterNode in RawChapterList.Skip(1)) { HtmlNode ChapterNumberNode = RawChapterNode.SelectSingleNode(".//div[1]/a"), ReleaseDate = RawChapterNode.SelectSingleNode(".//div[2]/time"); String ChapterNumber = Regex.Match(ChapterNumberNode.InnerText, @"\d+(\.\d+)?").Value; String[] ChapterSub = ChapterNumber.Trim().Split('.'); DateTime Released = DateTime.Now; String ReleasedTxt = ReleaseDate.InnerText.ToLower(); if (ReleasedTxt.StartsWith("today")) { Released = DateTime.Today; } else if (ReleasedTxt.StartsWith("yesterday")) { Released = DateTime.Today.AddDays(-1); } else if (ReleasedTxt.EndsWith("ago")) { Int32 tDelta = 0; Int32.TryParse(ReleasedTxt.Split(' ')[0], out tDelta); if (ReleasedTxt.Contains("hours")) { Released = Released.AddHours(0 - tDelta); } if (ReleasedTxt.Contains("minutes")) { Released = Released.AddMinutes(0 - tDelta); } if (ReleasedTxt.Contains("seconds")) { Released = Released.AddSeconds(0 - tDelta); } } else { Released = DateTime.ParseExact(ReleasedTxt, "MM/dd/yyyy", CultureInfo.InvariantCulture); } ChapterObject Chapter = new ChapterObject() { Name = HtmlEntity.DeEntitize(RawChapterNode.SelectSingleNode(".//div[1]/gray").InnerText), Chapter = UInt32.Parse(ChapterSub[0]), Locations = { new LocationObject() { ExtensionName = ExtensionDescriptionAttribute.Name, ExtensionLanguage = ExtensionDescriptionAttribute.Language, Url = ExtensionDescriptionAttribute.RootUrl + ChapterNumberNode.Attributes["href"].Value }, }, Released = Released }; if (ChapterSub.Length == 2) { Chapter.SubChapter = UInt32.Parse(ChapterSub[1]); } Chapters.Add(Chapter); } Chapters.Reverse(); MangaObject MangaObj = new MangaObject() { Name = HtmlEntity.DeEntitize(MangaName), Description = HtmlEntity.DeEntitize(Description), AlternateNames = AlternateNames.ToList(), CoverLocations = { new LocationObject() { Url = Cover, ExtensionName = ExtensionDescriptionAttribute.Name, ExtensionLanguage = ExtensionDescriptionAttribute.Language } }, Authors = AuthorsArtists.ToList(), Artists = AuthorsArtists.ToList(), Genres = Genres.ToList(), Released = Chapters.First().Released, Chapters = Chapters }; MangaObj.AlternateNames.RemoveAll(an => an.ToLower().Equals("none")); MangaObj.Genres.RemoveAll(g => g.ToLower().Equals("none")); return(MangaObj); }
// Generates content of fontTablePart1. private static void GenerateFontTablePart1Content(FontTablePart fontTablePart1) { Fonts fonts1 = new Fonts() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 w15" } }; fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006"); fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"); fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml"); fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml"); Font font1 = new Font() { Name = "Calibri" }; Panose1Number panose1Number1 = new Panose1Number() { Val = "020F0502020204030204" }; FontCharSet fontCharSet1 = new FontCharSet() { Val = "00" }; FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "4000ACFF", UnicodeSignature2 = "00000001", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" }; font1.Append(panose1Number1); font1.Append(fontCharSet1); font1.Append(fontFamily1); font1.Append(pitch1); font1.Append(fontSignature1); Font font2 = new Font() { Name = "宋体" }; AltName altName1 = new AltName() { Val = "SimSun" }; Panose1Number panose1Number2 = new Panose1Number() { Val = "02010600030101010101" }; FontCharSet fontCharSet2 = new FontCharSet() { Val = "86" }; FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Auto }; Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "288F0000", UnicodeSignature2 = "00000016", UnicodeSignature3 = "00000000", CodePageSignature0 = "00040001", CodePageSignature1 = "00000000" }; font2.Append(altName1); font2.Append(panose1Number2); font2.Append(fontCharSet2); font2.Append(fontFamily2); font2.Append(pitch2); font2.Append(fontSignature2); Font font3 = new Font() { Name = "Times New Roman" }; Panose1Number panose1Number3 = new Panose1Number() { Val = "02020603050405020304" }; FontCharSet fontCharSet3 = new FontCharSet() { Val = "00" }; FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch3 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font3.Append(panose1Number3); font3.Append(fontCharSet3); font3.Append(fontFamily3); font3.Append(pitch3); font3.Append(fontSignature3); Font font4 = new Font() { Name = "Calibri Light" }; Panose1Number panose1Number4 = new Panose1Number() { Val = "020F0302020204030204" }; FontCharSet fontCharSet4 = new FontCharSet() { Val = "00" }; FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000207B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" }; font4.Append(panose1Number4); font4.Append(fontCharSet4); font4.Append(fontFamily4); font4.Append(pitch4); font4.Append(fontSignature4); fonts1.Append(font1); fonts1.Append(font2); fonts1.Append(font3); fonts1.Append(font4); fontTablePart1.Fonts = fonts1; }
// Generates content of fontTablePart1. private void GenerateFontTablePart1Content(FontTablePart fontTablePart1) { Fonts fonts1 = new Fonts() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 w15 w16se" } }; fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006"); fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"); fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml"); fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml"); fonts1.AddNamespaceDeclaration("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex"); Font font1 = new Font() { Name = "Symbol" }; Panose1Number panose1Number1 = new Panose1Number() { Val = "05050102010706020507" }; FontCharSet fontCharSet1 = new FontCharSet() { Val = "02" }; FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000" }; font1.Append(panose1Number1); font1.Append(fontCharSet1); font1.Append(fontFamily1); font1.Append(pitch1); font1.Append(fontSignature1); Font font2 = new Font() { Name = "Times New Roman" }; Panose1Number panose1Number2 = new Panose1Number() { Val = "02020603050405020304" }; FontCharSet fontCharSet2 = new FontCharSet() { Val = "00" }; FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C000784B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font2.Append(panose1Number2); font2.Append(fontCharSet2); font2.Append(fontFamily2); font2.Append(pitch2); font2.Append(fontSignature2); Font font3 = new Font() { Name = "Courier New" }; Panose1Number panose1Number3 = new Panose1Number() { Val = "02070309020205020404" }; FontCharSet fontCharSet3 = new FontCharSet() { Val = "00" }; FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Modern }; Pitch pitch3 = new Pitch() { Val = FontPitchValues.Fixed }; FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font3.Append(panose1Number3); font3.Append(fontCharSet3); font3.Append(fontFamily3); font3.Append(pitch3); font3.Append(fontSignature3); Font font4 = new Font() { Name = "Wingdings" }; Panose1Number panose1Number4 = new Panose1Number() { Val = "05000000000000000000" }; FontCharSet fontCharSet4 = new FontCharSet() { Val = "02" }; FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Auto }; Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000" }; font4.Append(panose1Number4); font4.Append(fontCharSet4); font4.Append(fontFamily4); font4.Append(pitch4); font4.Append(fontSignature4); Font font5 = new Font() { Name = "Calibri" }; Panose1Number panose1Number5 = new Panose1Number() { Val = "020F0502020204030204" }; FontCharSet fontCharSet5 = new FontCharSet() { Val = "00" }; FontFamily fontFamily5 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch5 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature5 = new FontSignature() { UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C000247B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font5.Append(panose1Number5); font5.Append(fontCharSet5); font5.Append(fontFamily5); font5.Append(pitch5); font5.Append(fontSignature5); Font font6 = new Font() { Name = "Arial" }; Panose1Number panose1Number6 = new Panose1Number() { Val = "020B0604020202020204" }; FontCharSet fontCharSet6 = new FontCharSet() { Val = "00" }; FontFamily fontFamily6 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch6 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature6 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font6.Append(panose1Number6); font6.Append(fontCharSet6); font6.Append(fontFamily6); font6.Append(pitch6); font6.Append(fontSignature6); Font font7 = new Font() { Name = "Cambria" }; Panose1Number panose1Number7 = new Panose1Number() { Val = "02040503050406030204" }; FontCharSet fontCharSet7 = new FontCharSet() { Val = "00" }; FontFamily fontFamily7 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch7 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature7 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "400004FF", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" }; font7.Append(panose1Number7); font7.Append(fontCharSet7); font7.Append(fontFamily7); font7.Append(pitch7); font7.Append(fontSignature7); Font font8 = new Font() { Name = "Verdana" }; Panose1Number panose1Number8 = new Panose1Number() { Val = "020B0604030504040204" }; FontCharSet fontCharSet8 = new FontCharSet() { Val = "00" }; FontFamily fontFamily8 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch8 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature8 = new FontSignature() { UnicodeSignature0 = "A10006FF", UnicodeSignature1 = "4000205B", UnicodeSignature2 = "00000010", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" }; font8.Append(panose1Number8); font8.Append(fontCharSet8); font8.Append(fontFamily8); font8.Append(pitch8); font8.Append(fontSignature8); Font font9 = new Font() { Name = "Tahoma" }; Panose1Number panose1Number9 = new Panose1Number() { Val = "020B0604030504040204" }; FontCharSet fontCharSet9 = new FontCharSet() { Val = "00" }; FontFamily fontFamily9 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch9 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature9 = new FontSignature() { UnicodeSignature0 = "E1002EFF", UnicodeSignature1 = "C000605B", UnicodeSignature2 = "00000029", UnicodeSignature3 = "00000000", CodePageSignature0 = "000101FF", CodePageSignature1 = "00000000" }; font9.Append(panose1Number9); font9.Append(fontCharSet9); font9.Append(fontFamily9); font9.Append(pitch9); font9.Append(fontSignature9); Font font10 = new Font() { Name = "Arial Black" }; Panose1Number panose1Number10 = new Panose1Number() { Val = "020B0A04020102020204" }; FontCharSet fontCharSet10 = new FontCharSet() { Val = "00" }; FontFamily fontFamily10 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch10 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature10 = new FontSignature() { UnicodeSignature0 = "A00002AF", UnicodeSignature1 = "400078FB", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" }; font10.Append(panose1Number10); font10.Append(fontCharSet10); font10.Append(fontFamily10); font10.Append(pitch10); font10.Append(fontSignature10); Font font11 = new Font() { Name = "MS Gothic" }; AltName altName1 = new AltName() { Val = "MS ゴシック" }; Panose1Number panose1Number11 = new Panose1Number() { Val = "020B0609070205080204" }; FontCharSet fontCharSet11 = new FontCharSet() { Val = "80" }; FontFamily fontFamily11 = new FontFamily() { Val = FontFamilyValues.Modern }; Pitch pitch11 = new Pitch() { Val = FontPitchValues.Fixed }; FontSignature fontSignature11 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "08000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font11.Append(altName1); font11.Append(panose1Number11); font11.Append(fontCharSet11); font11.Append(fontFamily11); font11.Append(pitch11); font11.Append(fontSignature11); Font font12 = new Font() { Name = "MS Mincho" }; AltName altName2 = new AltName() { Val = "Yu Gothic UI" }; Panose1Number panose1Number12 = new Panose1Number() { Val = "02020609040205080304" }; FontCharSet fontCharSet12 = new FontCharSet() { Val = "80" }; FontFamily fontFamily12 = new FontFamily() { Val = FontFamilyValues.Modern }; Pitch pitch12 = new Pitch() { Val = FontPitchValues.Fixed }; FontSignature fontSignature12 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font12.Append(altName2); font12.Append(panose1Number12); font12.Append(fontCharSet12); font12.Append(fontFamily12); font12.Append(pitch12); font12.Append(fontSignature12); Font font13 = new Font() { Name = "Segoe UI" }; Panose1Number panose1Number13 = new Panose1Number() { Val = "020B0502040204020203" }; FontCharSet fontCharSet13 = new FontCharSet() { Val = "00" }; FontFamily fontFamily13 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch13 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature13 = new FontSignature() { UnicodeSignature0 = "E4002EFF", UnicodeSignature1 = "C000E47F", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font13.Append(panose1Number13); font13.Append(fontCharSet13); font13.Append(fontFamily13); font13.Append(pitch13); font13.Append(fontSignature13); fonts1.Append(font1); fonts1.Append(font2); fonts1.Append(font3); fonts1.Append(font4); fonts1.Append(font5); fonts1.Append(font6); fonts1.Append(font7); fonts1.Append(font8); fonts1.Append(font9); fonts1.Append(font10); fonts1.Append(font11); fonts1.Append(font12); fonts1.Append(font13); fontTablePart1.Fonts = fonts1; }
// Generates content of fontTablePart1. private void GenerateFontTablePart1Content(FontTablePart fontTablePart1) { Fonts fonts1 = new Fonts(); Font font1 = new Font() { Name = "Times New Roman" }; Panose1Number panose1Number1 = new Panose1Number() { Val = "02020603050405020304" }; FontCharSet fontCharSet1 = new FontCharSet() { Val = "00" }; FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "20002A87", UnicodeSignature1 = "80000000", UnicodeSignature2 = "00000008", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font1.Append(panose1Number1); font1.Append(fontCharSet1); font1.Append(fontFamily1); font1.Append(pitch1); font1.Append(fontSignature1); Font font2 = new Font() { Name = "Wingdings" }; Panose1Number panose1Number2 = new Panose1Number() { Val = "05000000000000000000" }; FontCharSet fontCharSet2 = new FontCharSet() { Val = "02" }; FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Auto }; Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000" }; font2.Append(panose1Number2); font2.Append(fontCharSet2); font2.Append(fontFamily2); font2.Append(pitch2); font2.Append(fontSignature2); Font font3 = new Font() { Name = "MS Mincho" }; AltName altName1 = new AltName() { Val = "MS 明朝" }; Panose1Number panose1Number3 = new Panose1Number() { Val = "02020609040205080304" }; FontCharSet fontCharSet3 = new FontCharSet() { Val = "80" }; FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Modern }; Pitch pitch3 = new Pitch() { Val = FontPitchValues.Fixed }; FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "A00002BF", UnicodeSignature1 = "68C7FCFB", UnicodeSignature2 = "00000010", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font3.Append(altName1); font3.Append(panose1Number3); font3.Append(fontCharSet3); font3.Append(fontFamily3); font3.Append(pitch3); font3.Append(fontSignature3); Font font4 = new Font() { Name = "Arial" }; Panose1Number panose1Number4 = new Panose1Number() { Val = "020B0604020202020204" }; FontCharSet fontCharSet4 = new FontCharSet() { Val = "00" }; FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "20002A87", UnicodeSignature1 = "80000000", UnicodeSignature2 = "00000008", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font4.Append(panose1Number4); font4.Append(fontCharSet4); font4.Append(fontFamily4); font4.Append(pitch4); font4.Append(fontSignature4); Font font5 = new Font() { Name = "Tahoma" }; Panose1Number panose1Number5 = new Panose1Number() { Val = "020B0604030504040204" }; FontCharSet fontCharSet5 = new FontCharSet() { Val = "00" }; FontFamily fontFamily5 = new FontFamily() { Val = FontFamilyValues.Swiss }; NotTrueType notTrueType1 = new NotTrueType(); Pitch pitch5 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature5 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "00000001", CodePageSignature1 = "00000000" }; font5.Append(panose1Number5); font5.Append(fontCharSet5); font5.Append(fontFamily5); font5.Append(notTrueType1); font5.Append(pitch5); font5.Append(fontSignature5); Font font6 = new Font() { Name = "Arial Unicode MS" }; Panose1Number panose1Number6 = new Panose1Number() { Val = "020B0604020202020204" }; FontCharSet fontCharSet6 = new FontCharSet() { Val = "00" }; FontFamily fontFamily6 = new FontFamily() { Val = FontFamilyValues.Roman }; NotTrueType notTrueType2 = new NotTrueType(); Pitch pitch6 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature6 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "00000001", CodePageSignature1 = "00000000" }; font6.Append(panose1Number6); font6.Append(fontCharSet6); font6.Append(fontFamily6); font6.Append(notTrueType2); font6.Append(pitch6); font6.Append(fontSignature6); Font font7 = new Font() { Name = "Cambria" }; Panose1Number panose1Number7 = new Panose1Number() { Val = "02040503050406030204" }; FontCharSet fontCharSet7 = new FontCharSet() { Val = "00" }; FontFamily fontFamily7 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch7 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature7 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000004B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" }; font7.Append(panose1Number7); font7.Append(fontCharSet7); font7.Append(fontFamily7); font7.Append(pitch7); font7.Append(fontSignature7); Font font8 = new Font() { Name = "Calibri" }; Panose1Number panose1Number8 = new Panose1Number() { Val = "020F0502020204030204" }; FontCharSet fontCharSet8 = new FontCharSet() { Val = "00" }; FontFamily fontFamily8 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch8 = new Pitch() { Val = FontPitchValues.Variable }; FontSignature fontSignature8 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000207B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" }; font8.Append(panose1Number8); font8.Append(fontCharSet8); font8.Append(fontFamily8); font8.Append(pitch8); font8.Append(fontSignature8); fonts1.Append(font1); fonts1.Append(font2); fonts1.Append(font3); fonts1.Append(font4); fonts1.Append(font5); fonts1.Append(font6); fonts1.Append(font7); fonts1.Append(font8); fontTablePart1.Fonts = fonts1; }
// Generates content of fontTablePart1. private void GenerateFontTablePart1Content(FontTablePart fontTablePart1) { Fonts fonts1 = new Fonts(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15" } }; fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006"); fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"); fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml"); fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2010/11/wordml"); Font font1 = new Font(){ Name = "Century" }; Panose1Number panose1Number1 = new Panose1Number(){ Val = "02040604050505020304" }; FontCharSet fontCharSet1 = new FontCharSet(){ Val = "00" }; FontFamily fontFamily1 = new FontFamily(){ Val = FontFamilyValues.Roman }; Pitch pitch1 = new Pitch(){ Val = FontPitchValues.Variable }; FontSignature fontSignature1 = new FontSignature(){ UnicodeSignature0 = "00000287", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" }; font1.Append(panose1Number1); font1.Append(fontCharSet1); font1.Append(fontFamily1); font1.Append(pitch1); font1.Append(fontSignature1); Font font2 = new Font(){ Name = "MS 明朝" }; AltName altName1 = new AltName(){ Val = "MS Mincho" }; Panose1Number panose1Number2 = new Panose1Number(){ Val = "02020609040205080304" }; FontCharSet fontCharSet2 = new FontCharSet(){ Val = "80" }; FontFamily fontFamily2 = new FontFamily(){ Val = FontFamilyValues.Roman }; Pitch pitch2 = new Pitch(){ Val = FontPitchValues.Fixed }; FontSignature fontSignature2 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font2.Append(altName1); font2.Append(panose1Number2); font2.Append(fontCharSet2); font2.Append(fontFamily2); font2.Append(pitch2); font2.Append(fontSignature2); Font font3 = new Font(){ Name = "Times New Roman" }; Panose1Number panose1Number3 = new Panose1Number(){ Val = "02020603050405020304" }; FontCharSet fontCharSet3 = new FontCharSet(){ Val = "00" }; FontFamily fontFamily3 = new FontFamily(){ Val = FontFamilyValues.Roman }; Pitch pitch3 = new Pitch(){ Val = FontPitchValues.Variable }; FontSignature fontSignature3 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007841", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font3.Append(panose1Number3); font3.Append(fontCharSet3); font3.Append(fontFamily3); font3.Append(pitch3); font3.Append(fontSignature3); Font font4 = new Font(){ Name = "MS ゴシック" }; AltName altName2 = new AltName(){ Val = "MS Gothic" }; Panose1Number panose1Number4 = new Panose1Number(){ Val = "020B0609070205080204" }; FontCharSet fontCharSet4 = new FontCharSet(){ Val = "80" }; FontFamily fontFamily4 = new FontFamily(){ Val = FontFamilyValues.Modern }; Pitch pitch4 = new Pitch(){ Val = FontPitchValues.Fixed }; FontSignature fontSignature4 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font4.Append(altName2); font4.Append(panose1Number4); font4.Append(fontCharSet4); font4.Append(fontFamily4); font4.Append(pitch4); font4.Append(fontSignature4); Font font5 = new Font(){ Name = "Arial" }; Panose1Number panose1Number5 = new Panose1Number(){ Val = "020B0604020202020204" }; FontCharSet fontCharSet5 = new FontCharSet(){ Val = "00" }; FontFamily fontFamily5 = new FontFamily(){ Val = FontFamilyValues.Swiss }; Pitch pitch5 = new Pitch(){ Val = FontPitchValues.Variable }; FontSignature fontSignature5 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font5.Append(panose1Number5); font5.Append(fontCharSet5); font5.Append(fontFamily5); font5.Append(pitch5); font5.Append(fontSignature5); fonts1.Append(font1); fonts1.Append(font2); fonts1.Append(font3); fonts1.Append(font4); fonts1.Append(font5); fontTablePart1.Fonts = fonts1; }
public List <SearchResultObject> ParseSearch(String content) { List <SearchResultObject> SearchResults = new List <SearchResultObject>(); HtmlDocument SearchResultDocument = new HtmlDocument(); SearchResultDocument.LoadHtml(content); HtmlNode MainContainer = SearchResultDocument.DocumentNode.SelectSingleNode("//div[contains(@class,'mainContainer')]"); HtmlNodeCollection SearchResultNodes = MainContainer.SelectNodes(".//div[contains(@class,'well')]/div[contains(@class,'row') and (contains(@class,'available') or contains(@class,'unavailable'))]"); if (!Equals(SearchResultNodes, null)) { foreach (HtmlNode SearchResultNode in SearchResultNodes) { String ImgUrl = ExtensionDescriptionAttribute.RootUrl + SearchResultNode.SelectSingleNode(".//img").Attributes["src"].Value.Substring(2), Name = String.Empty, Link = String.Empty; LocationObject Cover = new LocationObject() { Url = ImgUrl, ExtensionName = ExtensionDescriptionAttribute.Name, ExtensionLanguage = ExtensionDescriptionAttribute.Language }; List <String> AlternateNames = new List <String>(), AuthorsArtists = new List <String>(), Genres = new List <String>(); foreach (HtmlNode DetailNode in SearchResultNode.SelectNodes(".//div[2]/div[contains(@class,'row')]")) { HtmlNode DetailTypeNode = DetailNode.SelectSingleNode(".//div[1]/b[1] | .//div[1]/strong[1]"), DetailTextNode = (DetailTypeNode != null) ? DetailTypeNode.NextSibling : null, DetailDescriptionNode = (DetailTextNode != null) ? DetailTextNode.NextSibling : null, MangaNameNode = DetailNode.SelectSingleNode(".//div[1]/h1/a"); HtmlNodeCollection DetailLinkNodes = DetailNode.SelectNodes(".//div[1]/a"); String DetailType = (DetailTypeNode != null) ? DetailTypeNode.InnerText.Trim().TrimEnd(':') : "MangaName", DetailValue = String.Empty; String[] DetailValues = { }; if (DetailLinkNodes != null) { DetailValues = (from HtmlNode LinkNode in DetailLinkNodes select LinkNode.InnerText).ToArray(); } else if (MangaNameNode != null) { DetailValue = HtmlEntity.DeEntitize(MangaNameNode.InnerText.Trim()); } else if (DetailDescriptionNode != null) { DetailValue = HtmlEntity.DeEntitize(DetailDescriptionNode.InnerText.Trim()); } else if (DetailTextNode != null) { DetailValue = HtmlEntity.DeEntitize(DetailTextNode.InnerText.Trim()); } switch (DetailType) { default: break; case "MangaName": Name = DetailValue; Link = MangaNameNode.Attributes["href"].Value; if (Link.StartsWith("../manga/?series=")) { Link = Link.Substring("../manga/?series=".Length); } else if (Link.StartsWith("../read-online/")) { Link = Link.Substring("../read-online/".Length); } else { Link = Name.Replace(" ", String.Empty); } break; case "Alternate Names": AlternateNames = (from String AltName in DetailValue.Split(',') select AltName.Trim()).ToList(); break; case "Author": AuthorsArtists = DetailValues.ToList(); break; case "Genre": Genres = DetailValues.ToList(); break; } } SearchResults.Add(new SearchResultObject() { Cover = Cover, Name = Name, Url = String.Format("{0}/read-online/{1}", ExtensionDescriptionAttribute.RootUrl, Link), ExtensionName = ExtensionDescriptionAttribute.Name, ExtensionLanguage = ExtensionDescriptionAttribute.Language, Rating = -1, Artists = AuthorsArtists, Authors = AuthorsArtists }); } } return(SearchResults); }
// Generates content of fontTablePart2. private void GenerateFontTablePart2Content(FontTablePart fontTablePart2) { Fonts fonts2 = new Fonts(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15" } }; fonts2.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006"); fonts2.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); fonts2.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"); fonts2.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml"); fonts2.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2010/11/wordml"); Font font6 = new Font(){ Name = "Century" }; Panose1Number panose1Number6 = new Panose1Number(){ Val = "02040604050505020304" }; FontCharSet fontCharSet6 = new FontCharSet(){ Val = "00" }; FontFamily fontFamily6 = new FontFamily(){ Val = FontFamilyValues.Roman }; Pitch pitch6 = new Pitch(){ Val = FontPitchValues.Variable }; FontSignature fontSignature6 = new FontSignature(){ UnicodeSignature0 = "00000287", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" }; font6.Append(panose1Number6); font6.Append(fontCharSet6); font6.Append(fontFamily6); font6.Append(pitch6); font6.Append(fontSignature6); Font font7 = new Font(){ Name = "MS 明朝" }; AltName altName3 = new AltName(){ Val = "MS Mincho" }; Panose1Number panose1Number7 = new Panose1Number(){ Val = "02020609040205080304" }; FontCharSet fontCharSet7 = new FontCharSet(){ Val = "80" }; FontFamily fontFamily7 = new FontFamily(){ Val = FontFamilyValues.Roman }; Pitch pitch7 = new Pitch(){ Val = FontPitchValues.Fixed }; FontSignature fontSignature7 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font7.Append(altName3); font7.Append(panose1Number7); font7.Append(fontCharSet7); font7.Append(fontFamily7); font7.Append(pitch7); font7.Append(fontSignature7); Font font8 = new Font(){ Name = "Times New Roman" }; Panose1Number panose1Number8 = new Panose1Number(){ Val = "02020603050405020304" }; FontCharSet fontCharSet8 = new FontCharSet(){ Val = "00" }; FontFamily fontFamily8 = new FontFamily(){ Val = FontFamilyValues.Roman }; Pitch pitch8 = new Pitch(){ Val = FontPitchValues.Variable }; FontSignature fontSignature8 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007841", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font8.Append(panose1Number8); font8.Append(fontCharSet8); font8.Append(fontFamily8); font8.Append(pitch8); font8.Append(fontSignature8); Font font9 = new Font(){ Name = "MS ゴシック" }; AltName altName4 = new AltName(){ Val = "MS Gothic" }; Panose1Number panose1Number9 = new Panose1Number(){ Val = "020B0609070205080204" }; FontCharSet fontCharSet9 = new FontCharSet(){ Val = "80" }; FontFamily fontFamily9 = new FontFamily(){ Val = FontFamilyValues.Modern }; Pitch pitch9 = new Pitch(){ Val = FontPitchValues.Fixed }; FontSignature fontSignature9 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" }; font9.Append(altName4); font9.Append(panose1Number9); font9.Append(fontCharSet9); font9.Append(fontFamily9); font9.Append(pitch9); font9.Append(fontSignature9); Font font10 = new Font(){ Name = "Arial" }; Panose1Number panose1Number10 = new Panose1Number(){ Val = "020B0604020202020204" }; FontCharSet fontCharSet10 = new FontCharSet(){ Val = "00" }; FontFamily fontFamily10 = new FontFamily(){ Val = FontFamilyValues.Swiss }; Pitch pitch10 = new Pitch(){ Val = FontPitchValues.Variable }; FontSignature fontSignature10 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" }; font10.Append(panose1Number10); font10.Append(fontCharSet10); font10.Append(fontFamily10); font10.Append(pitch10); font10.Append(fontSignature10); fonts2.Append(font6); fonts2.Append(font7); fonts2.Append(font8); fonts2.Append(font9); fonts2.Append(font10); fontTablePart2.Fonts = fonts2; }
// Generates content of fontTablePart1. private void GenerateFontTablePart1Content(FontTablePart fontTablePart1) { Fonts fonts1 = new Fonts(); fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"); fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); Font font1 = new Font() { Name = "Times New Roman" }; FontCharSet fontCharSet1 = new FontCharSet() { Val = "00", StrictCharacterSet = new EnumValue<StrictCharacterSet>() { InnerText = "windows-1252" } }; FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable }; font1.Append(fontCharSet1); font1.Append(fontFamily1); font1.Append(pitch1); Font font2 = new Font() { Name = "Symbol" }; FontCharSet fontCharSet2 = new FontCharSet() { Val = "02" }; FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable }; font2.Append(fontCharSet2); font2.Append(fontFamily2); font2.Append(pitch2); Font font3 = new Font() { Name = "Arial" }; FontCharSet fontCharSet3 = new FontCharSet() { Val = "00", StrictCharacterSet = new EnumValue<StrictCharacterSet>() { InnerText = "windows-1252" } }; FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Swiss }; Pitch pitch3 = new Pitch() { Val = FontPitchValues.Variable }; font3.Append(fontCharSet3); font3.Append(fontFamily3); font3.Append(pitch3); Font font4 = new Font() { Name = "Liberation Serif" }; AltName altName1 = new AltName() { Val = "Times New Roman" }; FontCharSet fontCharSet4 = new FontCharSet() { Val = "cc", StrictCharacterSet = StrictCharacterSet.chsRussian }; FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable }; font4.Append(altName1); font4.Append(fontCharSet4); font4.Append(fontFamily4); font4.Append(pitch4); Font font5 = new Font() { Name = "Times New Roman" }; FontCharSet fontCharSet5 = new FontCharSet() { Val = "cc", StrictCharacterSet = StrictCharacterSet.chsRussian }; FontFamily fontFamily5 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch5 = new Pitch() { Val = FontPitchValues.Variable }; font5.Append(fontCharSet5); font5.Append(fontFamily5); font5.Append(pitch5); Font font6 = new Font() { Name = "Liberation Sans" }; AltName altName2 = new AltName() { Val = "Arial" }; FontCharSet fontCharSet6 = new FontCharSet() { Val = "cc", StrictCharacterSet = StrictCharacterSet.chsRussian }; FontFamily fontFamily6 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch6 = new Pitch() { Val = FontPitchValues.Variable }; font6.Append(altName2); font6.Append(fontCharSet6); font6.Append(fontFamily6); font6.Append(pitch6); Font font7 = new Font() { Name = "Symbol" }; FontCharSet fontCharSet7 = new FontCharSet() { Val = "cc", StrictCharacterSet = StrictCharacterSet.chsRussian }; FontFamily fontFamily7 = new FontFamily() { Val = FontFamilyValues.Roman }; Pitch pitch7 = new Pitch() { Val = FontPitchValues.Variable }; font7.Append(fontCharSet7); font7.Append(fontFamily7); font7.Append(pitch7); fonts1.Append(font1); fonts1.Append(font2); fonts1.Append(font3); fonts1.Append(font4); fonts1.Append(font5); fonts1.Append(font6); fonts1.Append(font7); fontTablePart1.Fonts = fonts1; }