/// ------------------------------------------------------------------------------------ /// <summary> /// If the current selection contains one run with a character style or multiple runs /// with the same character style this method returns the character style; otherwise /// returns the paragraph style unless multiple paragraphs are selected that have /// different paragraph styles. /// </summary> /// <param name="styleName">Gets the styleName</param> /// <returns> /// The styleType or -1 if no style type can be found or multiple style types /// are in the selection. Otherwise returns the styletype /// </returns> /// ------------------------------------------------------------------------------------ public override int GetStyleNameFromSelection(out string styleName) { if (m_decoratedEditingHelper != null) { return(m_decoratedEditingHelper.GetStyleNameFromSelection(out styleName)); } return(base.GetStyleNameFromSelection(out styleName)); }