Show / Hide Table of Contents

Class Notifications

A collection of services used to notify the user.

Inheritance
System.Object
Notifications
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Community.VisualStudio.Toolkit
Assembly: Community.VisualStudio.Toolkit.dll
Syntax
public class Notifications

Methods

| Improve this Doc View Source

ClearStatusbarAsync()

Clears all text from the status bar.

Declaration
public Task ClearStatusbarAsync()
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

EndStatusbarAnimationAsync(StatusAnimation)

Ends the animation on the status bar.

Declaration
public Task EndStatusbarAnimationAsync(StatusAnimation animation)
Parameters
Type Name Description
StatusAnimation animation
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

GetActivityLogAsync()

Used to write log messaged to the ActivityLog.xml file.

Declaration
public Task<IVsActivityLog> GetActivityLogAsync()
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Interop.IVsActivityLog>
| Improve this Doc View Source

GetInfoBarUIFactoryAsync()

The Infobar is often referred to as the 'yellow' or 'gold' bar.

Declaration
public Task<object> GetInfoBarUIFactoryAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.Object>

Cast return object to Microsoft.VisualStudio.Shell.Interop.IVsInfoBarUIFactory

| Improve this Doc View Source

GetStatusbarAsync()

Provides access to the environment's status bar.

Declaration
public Task<IVsStatusbar> GetStatusbarAsync()
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Interop.IVsStatusbar>
| Improve this Doc View Source

GetStatusbarTextAsync()

Gets the current text from the status bar.

Declaration
public Task<string> GetStatusbarTextAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

GetTaskStatusCenterAsync()

The Task Status Center is used to run background tasks and is located in the left-most side of the Status bar.

Declaration
public Task<IVsTaskStatusCenterService> GetTaskStatusCenterAsync()
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.VisualStudio.TaskStatusCenter.IVsTaskStatusCenterService>
Remarks

This is only available for Visual Studio 2019 (16.0).

| Improve this Doc View Source

GetThreadedWaitDialogAsync()

Used for background tasks that needs to block the UI if they take longer than the specified seconds.

Declaration
public Task<object> GetThreadedWaitDialogAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.Object>

Cast return object to Microsoft.VisualStudio.Shell.Interop.IVsThreadedWaitDialogFactory

| Improve this Doc View Source

SetStatusbarTextAsync(String)

Sets the text in the status bar.

Declaration
public Task SetStatusbarTextAsync(string text)
Parameters
Type Name Description
System.String text
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

ShowConfirm(String, String)

Shows a yes/no/cancel message box .

Declaration
public bool ShowConfirm(string title, string message)
Parameters
Type Name Description
System.String title
System.String message
Returns
Type Description
System.Boolean

true if the user clicks the 'Yes' button.

| Improve this Doc View Source

ShowError(String, String)

Shows an error message box.

Declaration
public VSConstants.MessageBoxResult ShowError(string title, string message)
Parameters
Type Name Description
System.String title
System.String message
Returns
Type Description
Microsoft.VisualStudio.VSConstants.MessageBoxResult

The result of which button on the message box was clicked.

| Improve this Doc View Source

ShowMessage(String, String, OLEMSGICON, OLEMSGBUTTON, OLEMSGDEFBUTTON)

Shows a message box that is parented to the main Visual Studio window

Declaration
public VSConstants.MessageBoxResult ShowMessage(string title, string message, OLEMSGICON icon = OLEMSGICON.OLEMSGICON_INFO, OLEMSGBUTTON buttons = OLEMSGBUTTON.OLEMSGBUTTON_OKCANCEL, OLEMSGDEFBUTTON defaultButton = OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST)
Parameters
Type Name Description
System.String title
System.String message
Microsoft.VisualStudio.Shell.Interop.OLEMSGICON icon
Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON buttons
Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON defaultButton
Returns
Type Description
Microsoft.VisualStudio.VSConstants.MessageBoxResult

The result of which button on the message box was clicked.

Examples
VS.Notifications.ShowMessage("Title", "The message");
| Improve this Doc View Source

ShowWarning(String, String)

Shows a warning message box.

Declaration
public VSConstants.MessageBoxResult ShowWarning(string title, string message)
Parameters
Type Name Description
System.String title
System.String message
Returns
Type Description
Microsoft.VisualStudio.VSConstants.MessageBoxResult

The result of which button on the message box was clicked.

| Improve this Doc View Source

StartStatusbarAnimationAsync(StatusAnimation)

Starts the animation on the status bar.

Declaration
public Task StartStatusbarAnimationAsync(StatusAnimation animation)
Parameters
Type Name Description
StatusAnimation animation
Returns
Type Description
System.Threading.Tasks.Task
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX