RegisterEditor() 정적인 개인적인 메소드

static private RegisterEditor ( VSCodeEditorWindow editor ) : void
editor VSCodeEditorWindow
리턴 void
예제 #1
0
 /// <summary>
 /// Registers the editor to re-add handles and events to the window.
 /// </summary>
 public void RegisterEditor()
 {
     if (_nativeWindow != null)
     {
         EditorBroker.RegisterEditor(_nativeWindow);
     }
 }
예제 #2
0
        public VSCodeEditorWindow(ServiceBroker sb, VSCodeEditorUserControl parent)
        {
            Parent     = parent;
            services   = sb;
            coreEditor = new VSCodeEditor(Parent, services);

            //Create window
            IVsCodeWindow win = coreEditor.CodeWindow;

            cmdTarget = win as IOleCommandTarget;

            IVsTextView textView;
            int         hr = win.GetPrimaryView(out textView);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            // assign the window handle
            IntPtr commandHwnd = textView.GetWindowHandle();

            AssignHandle(commandHwnd);

            //// Register priority command target, this dispatches mappable keys like Enter, Backspace, Arrows, etc.
            //hr = services.VsRegisterPriorityCommandTarget.RegisterPriorityCommandTarget(
            //    0, (IOleCommandTarget)CommandBroker.Broker, out cmdTargetCookie);

            //if (hr != VSConstants.S_OK)
            //  Marshal.ThrowExceptionForHR(hr);

            lock (typeof(EditorBroker))
            {
                if (EditorBroker.Broker == null)
                {
                    EditorBroker.CreateSingleton(services);
                }
                EditorBroker.RegisterEditor(this);
            }
            //Add message filter
            //Application.AddMessageFilter((System.Windows.Forms.IMessageFilter)this);
        }