示例#1
0
    public static IVsUIShell GetIVsUIShell(IServiceProvider serviceProvider)
    {
        IVsDataHostService hostService = serviceProvider.GetService(
            typeof(IVsDataHostService)) as IVsDataHostService;

        return(hostService.GetService <IVsUIShell>());
    }
示例#2
0
 public static void UpdateUI(IVsDataHostService hostService)
 {
     if (hostService.UIThread == Thread.CurrentThread)
     {
         // Called on UI thread, directly call method
         ActuallyUpdateUI(hostService);
     }
     else
     {
         // Called from background thread, invoke on UI thread
         hostService.InvokeOnUIThread(
             new UpdateUIDelegate(ActuallyUpdateUI),
             hostService);
     }
 }
示例#3
0
 public static IVsUIShell GetIVsUIShell(IVsDataHostService hostService)
 {
     return(hostService.TryGetService <IVsUIShell>(SID_IVsUIShell));
 }
示例#4
0
    private static void ActuallyUpdateUI(IVsDataHostService hostService)
    {
        IVsUIShell uiShell = hostService.GetService <IVsUIShell>();

        uiShell.UpdateCommandUI(0); // fImmediateUpdate == false
    }
示例#5
0
 public static IVsUIShell GetIVsUIShell(IVsDataHostService hostService)
 {
     return(hostService.TryGetService <SVsUIShell, IVsUIShell>());
 }