Example #1
0
 public StyleSheet GetStyle(string id)
 {
     if (styles.TryGetValue(id, out var styleSheet))
     {
         return(styleSheet);
     }
     return(defaultStyle ? defaultStyle : DefaultStyle);
 }
Example #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Get the OXES information for the given character style, creating a temporary userCS
        /// object if needed.
        /// </summary>
        /// <param name="style"></param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        static public OxesInfo GetOxesInfoForCharStyle(string style)
        {
            OxesInfo oxes;

            if (String.IsNullOrEmpty(style))
            {
                return(m_emptyChar);
            }
            else if (StyleMap.TryGetValue(style, out oxes) && oxes.m_fIsCharStyle)
            {
                return(oxes);
            }
            else
            {
                return(new OxesInfo(true, style, OxesContext.Default, "userCS", "type", style, null, null, false, false));
            }
        }
Example #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Get the OXES information for the given paragraph style, creating a temporary userPS
        /// object if needed.
        /// </summary>
        /// <param name="style">The style.</param>
        /// <param name="fSectionHead">if set to <c>true</c> this is a section head style (used
        /// only for non-standard styles).</param>
        /// ------------------------------------------------------------------------------------
        static public OxesInfo GetOxesInfoForParaStyle(string style, bool fSectionHead)
        {
            OxesInfo oxes;

            if (String.IsNullOrEmpty(style))
            {
                return(m_emptyPara);
            }
            else if (StyleMap.TryGetValue(style, out oxes) && !oxes.m_fIsCharStyle)
            {
                return(oxes);
            }
            else if (fSectionHead)
            {
                return(new OxesInfo(false, style, OxesContext.NormalSection, null, null, null, null, null, false, true));
            }
            else
            {
                return(new OxesInfo(false, style, OxesContext.Default, "p", "type", "userPS", "subType", style, false, false));
            }
        }