/// ------------------------------------------------------------------------------------ /// <summary> /// Creates the style lists needed for Scripture checking. /// </summary> /// <param name="smi">information needed for Scripture checking from all styles</param> /// ------------------------------------------------------------------------------------ private void CreateStyleLists(StyleMarkupInfo smi) { foreach (StyleMarkup style in smi.StyleMarkupList) { StyleInfo.StyleTypes styleType = (style.Type == "paragraph") ? StyleInfo.StyleTypes.paragraph : StyleInfo.StyleTypes.character; string styleName = style.Id.Replace("_", " "); // The following uses should begin with a capital letter: // * sentence initial // * proper name // * table // * list // * special (e.g. interlude, closing) // Save them in their own list so that we can report an appropriate error to the user. if (style.Use == "proseSentenceInitial") { StylePropsInfo.s_sentenceInitial.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.prose)); } else if (style.Use == "lineSentenceInitial") { StylePropsInfo.s_sentenceInitial.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.line)); } else if (style.Use == "properNoun") { StylePropsInfo.s_properNoun.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.other)); } else if (style.Use == "table") { StylePropsInfo.s_table.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.other)); } else if (style.Use == "list") { StylePropsInfo.s_list.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.other)); } else if (style.Use == "special") { StylePropsInfo.s_special.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.other)); } else if (style.Use == "stanzabreak") { StylePropsInfo.s_special.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.stanzabreak)); } // Titles should begin with a capital letter. Styles used for titles have a context of "title". if (!string.IsNullOrEmpty(style.Context) && style.Context == "title") { StylePropsInfo.s_title.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.other)); } // Headings should begin with a capital letter. Styles used for headings have a structure of "heading". if (!string.IsNullOrEmpty(style.Structure) && style.Structure == "heading") { StylePropsInfo.s_heading.Add(new StyleInfo(styleName, styleType, StyleInfo.UseTypes.other)); } } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="StyleCapInfo"/> class. /// </summary> /// <param name="type">The type of style (character or paragraph).</param> /// <param name="capCheck">The reason for the capitalization in this style.</param> /// ------------------------------------------------------------------------------------ public StyleCapInfo(StyleInfo.StyleTypes type, CapCheckTypes capCheck) { m_type = type; m_capCheck = capCheck; }