<tfoot id='Mab1d'></tfoot>
  • <legend id='Mab1d'><style id='Mab1d'><dir id='Mab1d'><q id='Mab1d'></q></dir></style></legend>
    1. <i id='Mab1d'><tr id='Mab1d'><dt id='Mab1d'><q id='Mab1d'><span id='Mab1d'><b id='Mab1d'><form id='Mab1d'><ins id='Mab1d'></ins><ul id='Mab1d'></ul><sub id='Mab1d'></sub></form><legend id='Mab1d'></legend><bdo id='Mab1d'><pre id='Mab1d'><center id='Mab1d'></center></pre></bdo></b><th id='Mab1d'></th></span></q></dt></tr></i><div id='Mab1d'><tfoot id='Mab1d'></tfoot><dl id='Mab1d'><fieldset id='Mab1d'></fieldset></dl></div>
        <bdo id='Mab1d'></bdo><ul id='Mab1d'></ul>
    2. <small id='Mab1d'></small><noframes id='Mab1d'>

        Win10中的拼写检查文本框 - 慢

        时间:2023-06-09
        <legend id='jptH3'><style id='jptH3'><dir id='jptH3'><q id='jptH3'></q></dir></style></legend>

        • <bdo id='jptH3'></bdo><ul id='jptH3'></ul>
          • <tfoot id='jptH3'></tfoot>
                <tbody id='jptH3'></tbody>

              <small id='jptH3'></small><noframes id='jptH3'>

            • <i id='jptH3'><tr id='jptH3'><dt id='jptH3'><q id='jptH3'><span id='jptH3'><b id='jptH3'><form id='jptH3'><ins id='jptH3'></ins><ul id='jptH3'></ul><sub id='jptH3'></sub></form><legend id='jptH3'></legend><bdo id='jptH3'><pre id='jptH3'><center id='jptH3'></center></pre></bdo></b><th id='jptH3'></th></span></q></dt></tr></i><div id='jptH3'><tfoot id='jptH3'></tfoot><dl id='jptH3'><fieldset id='jptH3'></fieldset></dl></div>

                  本文介绍了Win10中的拼写检查文本框 - 慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 WPF 中使用内置的拼写检查器.在我让用户开始升级到 Windows 10 之前,它工作得很好……我认为问题在于它被用于许多小文本框.我的应用程序显示了一个网格(Telerik 的 TreeListView),其中包含我要检查拼写的列之一的文本框.我需要能够为拼写检查器提供自定义字典;我能够做到这一点的唯一方法是订阅文本框加载事件并添加如下路径:

                  I'm using the built in spell checker in WPF. It was working just fine until I had users start upgrading to windows 10... I think the issue is that it's being used for a lot of small text boxes. My application presents a grid (Telerik's TreeListView) with text boxes for one of the columns which i want spell checked. I need to be able to provide a custom dictionary to the spell checker; the only way I was able to do this was to subscribe to the textbox loaded event and add the paths in as follows:

                          TextBox tb = sender as TextBox;
                          tb.ContextMenu = ctx_Spell;
                          IList dcts = SpellCheck.GetCustomDictionaries(tb);
                  
                          dictsList.Add(dcts);
                          if (KMApplication.Settings.UserDictionary != null)
                          { dcts.Add(KMApplication.Settings.UserDictionary); }
                  
                          foreach (Uri dct in KMApplication.Settings.RevitDictonaries)
                          { dcts.Add(dct); }
                  

                  当然,这会为每个文本框调用 add,这似乎非常浪费,但它似乎工作得很好,几乎没有明显的滞后,而且只有在加载时.但是现在在 Windows 10 上,这似乎是一个荒谬的滞后.在我的 Windows 8.1 机器上,我加载了一个包含几千行的文件,它会在大约 3 或 4 秒内出现;在我的 Windows 10 盒子上,它会在大约 10-15 分钟内出现.如果我注释掉上述代码的自定义字典部分,它在任何一台机器上都会恢复到大约 3-4 秒.

                  Granted this calls the add for each and every text box which seems terribly wasteful, but it seemed to be working just fine with little noticeable lag and only on load up. However now on Windows 10 it seems to be a ridiculous lag. On my Windows 8.1 machine I load up a file with a few thousand rows and it appears in about 3 or 4 seconds; on my Windows 10 box, it appears in about 10-15 minutes. If I comment out the custom dictionaries portion of the above code it's back to about 3-4 seconds on either machine.

                  有人知道更好的方法吗?或者如果在 Win10 中有一些解决方法?

                  Does anyone know a better way to do this? Or if there is some way around it in Win10?

                  推荐答案

                  从.NET 4.6.1(Win8.1 & Win10)开始,WPF使用OS公开的ISpellChecker接口来实现其SpellChecker,性能特点确实可能有些不同.

                  Starting .NET 4.6.1 (in Win8.1 & Win10), WPF uses ISpellChecker interface exposed by the OS to implement its SpellChecker, and the performance characteristics could be somewhat different indeed.

                  值得注意的是,ISpellChecker 的自定义字典注册器在全球范围内起作用 - 它不再充当每个控件的注册.(请参阅下面的知识库文章链接).因此,为每个控件一遍又一遍地注册相同的字典集是一种浪费,并且可能会降低您的性能.此外,操作系统会在达到内部限制时开始忽略您的字典.

                  Notably, ISpellChecker's custom dictionary registrar acts globally - it no longer acts as a per-control registration. (See KB article link below). As a result, registering the same set of dictionaries over and over for each control is wasteful and can potentially degrade your performance. Besides, the OS will just start ignoring your dictionaries when it reaches an internal limit.

                  只需注册一次字典,或使用 http://blogs.msdn.com/b/wpf/archive/2015/10/29/wpf-in-net-4-6-1.aspx 并将文件放在 %appdata%microsoftspelling 下.

                  Just register the dictionaries once, or use the alternative registration mechanism outlined at http://blogs.msdn.com/b/wpf/archive/2015/10/29/wpf-in-net-4-6-1.aspx and place the files under %appdata%microsoftspelling.

                  如果您需要在 Win7/Win8 以及 Win8.1/Win10 上运行相同的应用程序,您可能需要检测操作系统并分支您的字典注册策略.

                  If you need to run the same application on Win7/Win8 as well as Win8.1/Win10, you may need to detect the OS and branch your dictionary registration strategy.

                  一般来说,自定义字典的典型用法应该继续照常工作 - .NET 4.6.1 与以前的版本之间几乎没有区别.

                  In general, typical uses of custom dictionaries should continue working as usual - with little difference between .NET 4.6.1 vs previous releases.

                  另请参阅 https://support.microsoft.com/en-us/kb/3088234 了解更多信息.

                  Also see https://support.microsoft.com/en-us/kb/3088234 for additional information.

                  这篇关于Win10中的拼写检查文本框 - 慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:具有 Like 子句功能的自动完成文本框示例 %hello% C# Windows 下一篇:文本框宽度问题 - ASP.NET

                  相关文章

                    <tfoot id='U3XbM'></tfoot>
                  1. <legend id='U3XbM'><style id='U3XbM'><dir id='U3XbM'><q id='U3XbM'></q></dir></style></legend>
                  2. <i id='U3XbM'><tr id='U3XbM'><dt id='U3XbM'><q id='U3XbM'><span id='U3XbM'><b id='U3XbM'><form id='U3XbM'><ins id='U3XbM'></ins><ul id='U3XbM'></ul><sub id='U3XbM'></sub></form><legend id='U3XbM'></legend><bdo id='U3XbM'><pre id='U3XbM'><center id='U3XbM'></center></pre></bdo></b><th id='U3XbM'></th></span></q></dt></tr></i><div id='U3XbM'><tfoot id='U3XbM'></tfoot><dl id='U3XbM'><fieldset id='U3XbM'></fieldset></dl></div>
                  3. <small id='U3XbM'></small><noframes id='U3XbM'>

                      <bdo id='U3XbM'></bdo><ul id='U3XbM'></ul>