private List <IStyleInfo> GetQuickStyleDefs() { // collect Heading quick style defs (h1, h2, h3, ...) var templates = new List <IStyleInfo>(); var quickdefs = page.Elements(ns + "QuickStyleDef")?.Select(e => new QuickInfo(e)); if (quickdefs?.Count() > 0) { templates.AddRange(quickdefs); } defaultInfo = templates.FirstOrDefault(e => e.Name.Equals("P")); if (defaultInfo == null) { defaultInfo = new CssInfo() { Name = "P", FontSize = "11.0pt" }; templates.Add(defaultInfo); } return(templates); }
public void Collect(IStyleInfo other) { if (Name == null) { Name = other.Name; } if (Index == null) { Index = other.Index; } if (FontFamily == null) { FontFamily = other.FontFamily; } if (FontSize == null) { FontSize = other.FontSize; } if (IsBold == null) { IsBold = other.IsBold; } if (IsItalic == null) { IsItalic = other.IsItalic; } if (IsUnderline == null) { IsUnderline = other.IsUnderline; } if (IsStrikethrough == null) { IsStrikethrough = other.IsStrikethrough; } if (IsSubscript == null) { IsSubscript = other.IsSubscript; } if (IsSuperscript == null) { IsSuperscript = other.IsSuperscript; } if (Color == null) { Color = other.Color; } if (Highlight == null) { Highlight = other.Highlight; } if (SpaceAfter == null) { SpaceAfter = other.SpaceAfter; } if (SpaceBefore == null) { SpaceBefore = other.SpaceBefore; } if (IsHeading == null) { IsHeading = other.IsHeading; } }