@@ -52,7 +52,9 @@ void RequestCalloutDisplay(Guid clientId, Guid calloutId, string title, string m
5252 Assumes . Present ( tippingService ) ;
5353 var parameterTypes = new Type [ ] { typeof ( Guid ) , typeof ( Guid ) , typeof ( string ) , typeof ( string ) ,
5454 typeof ( bool ) , typeof ( FrameworkElement ) , typeof ( Guid ) , typeof ( uint ) , typeof ( object ) } ;
55- var method = tippingService . GetType ( ) . GetMethod ( "RequestCalloutDisplay" , parameterTypes ) ;
55+ var method = tippingService . GetType ( ) . GetInterfaces ( )
56+ . Where ( i => i . Name == "IVsTippingService" )
57+ . FirstOrDefault ( ) ? . GetMethod ( "RequestCalloutDisplay" , parameterTypes ) ;
5658 var arguments = new object [ ] { clientId , calloutId , title , message , isPermanentlyDismissible , targetElement ,
5759 vsCommandGroupId , vsCommandId , commandOption } ;
5860 method . Invoke ( tippingService , arguments ) ;
@@ -73,7 +75,8 @@ void RequestCalloutDisplay(Guid clientId, Guid calloutId, string title, string m
7375 var parameterTypes = new Type [ ] { typeof ( Guid ) , typeof ( Guid ) , typeof ( string ) , typeof ( string ) , typeof ( bool ) ,
7476 typeof ( Microsoft . VisualStudio . OLE . Interop . POINT ) , typeof ( Guid ) , typeof ( uint ) } ;
7577 var tippingServiceType = tippingService . GetType ( ) ;
76- var method = tippingServiceType . GetMethod ( "RequestCalloutDisplay" , parameterTypes ) ;
78+ var method = tippingService . GetType ( ) . GetInterfaces ( ) . Where ( i => i . Name == "IVsTippingService" )
79+ . FirstOrDefault ( ) ? . GetMethod ( "RequestCalloutDisplay" , parameterTypes ) ;
7780 if ( method == null )
7881 {
7982 log . Error ( "Couldn't find method on {Type} with parameters {Parameters}" , tippingServiceType , parameterTypes ) ;
0 commit comments