When using the MMC (Microsoft Management Console) 3.0 I cannot get AsyncStatus message shown in console window.
I assume it is supposed to be displayed in the status bar of the MMC.
When using the StandardVerb (like OnRefresh
or OnExpand
) at least it is working with its default message (like Expand: In progress...
)
However, when I try to use status.ReportProgress([...])
or status.Complete([...])
it does not work.
Example:
class MyMMCListview : MmcListView {
[...]
protected override void OnAction(Microsoft.ManagementConsole.Action action, AsyncStatus status)
{
status.ReportProgress(1, 2, "Loading 1");
System.Threading.Thread.Sleep(3000);
status.ReportProgress(2, 2, "Loading 2");
System.Threading.Thread.Sleep(3000);
// default behavior
base.OnAction(action, status)
// Nothing done successfully
status.Complete("Done", true);
}
[...]
}
MmcListView: https://msdn.microsoft.com/en-us/library/microsoft.managementconsole.mmclistview_members(v=vs.90).aspx
AsyncStatus: https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.managementconsole.asyncstatus(v=vs.85).aspx
Any suggestions?
I've tested this several times and it seems that
ReportProgress
andComplete
are showing a message in the status bar only when they where called from an override in aScopeNode
.