Пример #1
0
        private SpellCheckerProperties EnsurePropertiesExists(IHtmlEditor key)
        {
            SpellCheckerProperties p = (SpellCheckerProperties)properties[key];

            if (p == null)
            {
                p = new SpellCheckerProperties(EnsureSpellCheckerExists(key));
                properties[key] = p;
            }
            return(p);
        }
Пример #2
0
        /// <summary>
        /// Support the designer infrastructure.
        /// </summary>
        /// <param name="htmlEditor"></param>
        /// <param name="props"></param>
        public void SetSpeller(IHtmlEditor htmlEditor, SpellCheckerProperties props)
        {
            if (props == null)
            {
                return;
            }
            if (props.HighLightStyle != null)
            {
                EnsurePropertiesExists(htmlEditor).HighLightStyle.LineColor           = props.HighLightStyle.LineColor;
                EnsurePropertiesExists(htmlEditor).HighLightStyle.LineThroughStyle    = props.HighLightStyle.LineThroughStyle;
                EnsurePropertiesExists(htmlEditor).HighLightStyle.LineType            = props.HighLightStyle.LineType;
                EnsurePropertiesExists(htmlEditor).HighLightStyle.Priority            = props.HighLightStyle.Priority;
                EnsurePropertiesExists(htmlEditor).HighLightStyle.TextBackgroundColor = props.HighLightStyle.TextBackgroundColor;
                EnsurePropertiesExists(htmlEditor).HighLightStyle.TextColor           = props.HighLightStyle.TextColor;
                EnsurePropertiesExists(htmlEditor).HighLightStyle.UnderlineStyle      = props.HighLightStyle.UnderlineStyle;
            }
            EnsurePropertiesExists(htmlEditor).IgnoreUpperCaseWords  = props.IgnoreUpperCaseWords;
            EnsurePropertiesExists(htmlEditor).IgnoreWordsWithDigits = props.IgnoreWordsWithDigits;
            EnsurePropertiesExists(htmlEditor).MaxSuggestionsCount   = props.MaxSuggestionsCount;
            EnsurePropertiesExists(htmlEditor).SuggestionType        = props.SuggestionType;
            EnsurePropertiesExists(htmlEditor).IgnoreHtml            = props.IgnoreHtml;
            EnsurePropertiesExists(htmlEditor).Dictionary            = props.Dictionary;
            EnsurePropertiesExists(htmlEditor).DictionaryPath        = props.DictionaryPath;
            EnsurePropertiesExists(htmlEditor).LanguageType          = props.LanguageType;
            EnsurePropertiesExists(htmlEditor).CheckInternal         = props.CheckInternal;
            EnsurePropertiesExists(htmlEditor).IgnoreList            = props.IgnoreList;
            EnsurePropertiesExists(htmlEditor).ReplaceList           = props.ReplaceList;

            EnsurePropertiesExists(htmlEditor).MainMenuVisible  = props.MainMenuVisible;
            EnsurePropertiesExists(htmlEditor).ToolStripVisible = props.ToolStripVisible;

            if (menuStripSpeller != null && menuStripSpeller.Items.Count > 0 && props.MainMenuVisible)
            {
                menuStripSpeller.Items[0].Visible = true;
                ((HtmlEditor)htmlEditor).MenuStrip.Items.Add(menuStripSpeller.Items[0]);
            }
            if (toolStripSpeller != null && props.ToolStripVisible)
            {
                toolStripSpeller.Visible = true;
                ((HtmlEditor)htmlEditor).ToolStripContainer.TopToolStripPanel.Controls.Add(toolStripSpeller);
            }

            htmlEditor.RegisterPlugIn(this);
            htmlEditor.Loaded += new GuruComponents.Netrix.Events.LoadEventHandler(htmlEditor_Loaded);
        }