@@ -146,7 +146,7 @@ private void RemoveChildControlsFromExposedControl()
146
146
public int /* IOleObject:: */ Close ( [ In ] uint dwSaveOption )
147
147
{
148
148
_logger . Log ( LogLevel . Trace , "IOleObject::Close() called" ) ;
149
- int hr = _userControl . IOleObject . Close ( dwSaveOption ) ;
149
+ var hr = _userControl . IOleObject . Close ( dwSaveOption ) ;
150
150
151
151
// IOleObject::SetClientSite is typically called with pClientSite = null just before calling IOleObject::Close()
152
152
// If it didn't, we release all host COM objects here instead,
@@ -438,6 +438,8 @@ private static void ToggleDockable(IntPtr hWndVBE)
438
438
[ ComVisible ( false ) ]
439
439
public class ParentWindow : SubclassingWindow
440
440
{
441
+ private readonly Logger _logger = LogManager . GetCurrentClassLogger ( ) ;
442
+
441
443
private const int MF_BYPOSITION = 0x400 ;
442
444
443
445
public event SubClassingWindowEventHandler CallBackEvent ;
@@ -484,20 +486,20 @@ private void DisplayUndockableContextMenu(IntPtr handle, IntPtr lParam)
484
486
485
487
if ( _menuHandle == IntPtr . Zero )
486
488
{
487
- Debug . Print ( "Cannot create menu handle" ) ;
489
+ _logger . Warn ( "Cannot create menu handle" ) ;
488
490
return ;
489
491
}
490
492
491
493
if ( ! NativeMethods . InsertMenu ( _menuHandle , 0 , MF_BYPOSITION , ( UIntPtr ) WM . RUBBERDUCK_UNDOCKABLE_CONTEXT_MENU , "Dockable" + char . MinValue ) )
492
494
{
493
- Debug . Print ( "Failed to insert a menu item for dockable command" ) ;
495
+ _logger . Warn ( "Failed to insert a menu item for dockable command" ) ;
494
496
}
495
497
}
496
498
497
499
var param = new LParam { Value = ( uint ) lParam } ;
498
500
if ( ! NativeMethods . TrackPopupMenuEx ( _menuHandle , 0x0 , param . LowWord , param . HighWord , handle , IntPtr . Zero ) )
499
501
{
500
- Debug . Print ( "Failed to set the context menu for undockable tool windows" ) ;
502
+ _logger . Warn ( "Failed to set the context menu for undockable tool windows" ) ;
501
503
} ;
502
504
}
503
505
@@ -553,7 +555,7 @@ public override int SubClassProc(IntPtr hWnd, IntPtr msg, IntPtr wParam, IntPtr
553
555
{
554
556
if ( ! NativeMethods . DestroyMenu ( _menuHandle ) )
555
557
{
556
- Debug . Print ( $ "Failed to destroy the menu handle { _menuHandle } ") ;
558
+ _logger . Fatal ( $ "Failed to destroy the menu handle { _menuHandle } ") ;
557
559
}
558
560
}
559
561
break ;
0 commit comments