static private RegisterEditor ( |
||
editor | ||
리턴 | void |
/// <summary> /// Registers the editor to re-add handles and events to the window. /// </summary> public void RegisterEditor() { if (_nativeWindow != null) { EditorBroker.RegisterEditor(_nativeWindow); } }
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); }