Exemple #1
0
 protected virtual void OnQueryCanCheckSpelling(QueryCanCheckSpellingEventArgs args)
 {
     if (QueryCanCheckSpelling != null)
     {
         QueryCanCheckSpelling(this, args);
     }
 }
Exemple #2
0
        /// <summary>
        /// Determines whether the specified form template is supposed to be spell checked.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="template"></param>
        /// <returns></returns>
        public virtual bool CanCheckSpelling(TemplateContext context, object template)
        {
            QueryCanCheckSpellingEventArgs args = new QueryCanCheckSpellingEventArgs(context, template);
            bool isTargetTemplate = (template != null) && (context == TemplateContext.ApplicationWindow ||
                                                           context == TemplateContext.PopupWindow ||
                                                           context == TemplateContext.View);

            args.Cancel = !(SpellCheckerOptions.Enabled && isTargetTemplate);
            OnQueryCanCheckSpelling(args);
            return(!args.Cancel);
        }