コード例 #1
0
        void EditorContext_PostEventNotify(object sender, MshtmlEditor.EditDesignerEventArgs args)
        {
            if (Attached)
            {
                switch (args.EventDispId)
                {
                case 0:
                    // WinLive 233200: JA-JP: photoalbum is created with subject instead of album name when album name specified in email body contains Japanese only
                    // We don't get key press events with IME input for languages such as Japanese that employ IME composition
                    // (e.g. multiple keystrokes to generate a single character).
                    if (String.Compare("COMPOSITION", args.EventObj.type, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        PersistSelectedEditField();
                    }
                    break;

                case DISPID_HTMLELEMENTEVENTS2.ONKEYPRESS:
                    PersistSelectedEditField();
                    break;

                default:
                    break;
                }
            }
        }
コード例 #2
0
        private void _blogPostHtmlEditorControl_PostEditorEvent(object sender, MshtmlEditor.EditDesignerEventArgs e)
        {
            if (e.EventDispId != DISPID_HTMLELEMENTEVENTS2.ONKEYPRESS)
            {
                return;
            }
            char c = Convert.ToChar(e.EventObj.keyCode);

            try
            {
                MaybeExecuteDelayedAutoReplaceOperation(c);
            }
            catch (Exception ex)
            {
                Trace.Fail("Error while handling posteditorevent, suppressing autocomplete " + ex);
                _delayedAutoReplaceAction = null;
                _haltAutoReplace          = true;
                throw;
            }
        }