Пример #1
0
        public void Check(ITextBox editor)
        {
            var dirtyWords = ServiceManager.Get <DirtyWordList>();

            if (dirtyWords == null || dirtyWords.Count < 1)
            {
                return;
            }

            ThreadPool.QueueUserWorkItem(p =>
            {
                foreach (var item in dirtyWords)
                {
                    var txt   = editor.GetProperty <string>("Text");
                    var index = txt.IndexOf(item);
                    if (index != -1)
                    {
                        editor.InvokeProperty("Text", txt.Replace(item, "".PadRight(item.Length, '*')));
                    }
                }
            });
        }