示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Updates the styles in the m_ctrl list based on the ExcludeStylesWithContext and
        /// ShowOnlyStylesOfType properties. This should be called when the caller wants to
        /// update the m_ctrl list after changing one of those two properties, but doesn't want
        /// to rebuild the entire m_styleItemList.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void Refresh()
        {
            if (m_ignoreListRefresh)
            {
                return;
            }

            string selectedStyle = ComboBoxControl.SelectedText;

            ComboBoxControl.Items.Clear();
            ComboBoxControl.BeginUpdate();
            RefreshStyleItemList(selectedStyle);
            ComboBoxControl.EndUpdate();
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Add item during refresh.
        /// </summary>
        /// <param name="items"></param>
        /// ------------------------------------------------------------------------------------
        protected override void UpdateStyleList(StyleListItem[] items)
        {
            if (m_ignoreListRefresh)
            {
                return;
            }

            string selectedStyle = ComboBoxControl.SelectedText;

            ComboBoxControl.Items.Clear();
            ComboBoxControl.BeginUpdate();
            ComboBoxControl.Items.AddRange(items);
            ComboBoxControl.EndUpdate();

            SelectedStyleName = selectedStyle;
        }