internal static void CompleteCurrentComposition(UnsafeNativeMethods.ITfDocumentMgr documentMgr) { UnsafeNativeMethods.ITfContext tfContext; documentMgr.GetBase(out tfContext); UnsafeNativeMethods.ITfCompositionView composition = FrameworkTextComposition.GetComposition(tfContext); if (composition != null) { UnsafeNativeMethods.ITfContextOwnerCompositionServices tfContextOwnerCompositionServices = tfContext as UnsafeNativeMethods.ITfContextOwnerCompositionServices; tfContextOwnerCompositionServices.TerminateComposition(composition); Marshal.ReleaseComObject(composition); } Marshal.ReleaseComObject(tfContext); }
public override void Complete() { // VerifyAccess(); UnsafeNativeMethods.ITfContext context = GetTransitoryContext(); UnsafeNativeMethods.ITfContextOwnerCompositionServices compositionService = context as UnsafeNativeMethods.ITfContextOwnerCompositionServices; UnsafeNativeMethods.ITfCompositionView composition = GetComposition(context); if (composition != null) { // Terminate composition if there is a composition view. compositionService.TerminateComposition(composition); Marshal.ReleaseComObject(composition); } Marshal.ReleaseComObject(context); }
//------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ internal static void CompleteCurrentComposition(UnsafeNativeMethods.ITfDocumentMgr documentMgr) { UnsafeNativeMethods.ITfContext context; documentMgr.GetBase(out context); UnsafeNativeMethods.ITfCompositionView composition = GetComposition(context); if (composition != null) { UnsafeNativeMethods.ITfContextOwnerCompositionServices compositionService = context as UnsafeNativeMethods.ITfContextOwnerCompositionServices; // Terminate composition if there is a composition view. compositionService.TerminateComposition(composition); Marshal.ReleaseComObject(composition); } Marshal.ReleaseComObject(context); }