Status Control
Customising Status Control using C# (.NET)
:
Classes in .NET
: Class StatusEvents
Class StatusEvents
This class gives access to all the status change events. An instance of the class cannot be instantiated directly by constructor. Instead an instance can be created from the Status.Events property, or from the static functions StatusEvent.GetStatusEventObject(Status s) or StatusEvent.GetStatusEventObject(). The following example shows the registration of an event handler for the BeforeStatusChange event together with a sample implementation of the registered event handler:
Status status = Status("/DesignStatus");
StatusEvent statusEvent = status.Event;
statusEvent.BeforeStatusChange +
= new
StatusEvent.BeforeStatusChangeEventHandler(My_BeforeStatusChange);
// ...
// Event handler
private void
My_BeforeStatusChange (
object
sender,
CancelStatusEventArgs e)
{
// Do any extra actions and check status change is allowed
if
( /* abort status change required */ )
{
e.Cancel =
true
;
e.Message = "reason not to proceed";
}
}
The list of available status events is displayed in the Visual Studio Object Browser display as follows:
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.