/// <summary> /// Handles the Disable method. /// </summary> protected virtual ServiceResult OnDisableCalled( ISystemContext context, MethodState method, IList <object> inputArguments, IList <object> outputArguments) { // check that method can be called. ServiceResult error = ProcessBeforeEnableDisable(context, false); if (ServiceResult.IsGood(error)) { Dictionary <string, ConditionState> branches = GetBranches(); foreach (ConditionState branch in branches.Values) { branch.OnDisableCalled(context, method, inputArguments, outputArguments); } UpdateStateAfterDisable(context); } // raise the audit event. if (this.AreEventsMonitored) { // report a state change event. if (ServiceResult.IsGood(error)) { ReportStateChange(context, true); } // raise the audit event. AuditConditionEnableEventState e = new AuditConditionEnableEventState(null); TranslationInfo info = new TranslationInfo( "AuditConditionEnable", "en-US", "The Disable method was called."); e.Initialize( context, this, EventSeverity.Low, new LocalizedText(info), ServiceResult.IsGood(error), DateTime.UtcNow); e.SourceName.Value = "Attribute/Call"; e.MethodId = new PropertyState <NodeId>(e); e.MethodId.Value = method.NodeId; ReportEvent(context, e); } return(error); }
/// <summary> /// Handles the Disable method. /// </summary> protected virtual ServiceResult OnDisableCalled( ISystemContext context, MethodState method, IList<object> inputArguments, IList<object> outputArguments) { // check that method can be called. ServiceResult error = ProcessBeforeEnableDisable(context, false); if (ServiceResult.IsGood(error)) { UpdateStateAfterDisable(context); } // raise the audit event. if (this.AreEventsMonitored) { // report a state change event. if (ServiceResult.IsGood(error)) { ReportStateChange(context, true); } // raise the audit event. AuditConditionEnableEventState e = new AuditConditionEnableEventState(null); TranslationInfo info = new TranslationInfo( "AuditConditionEnable", "en-US", "The Disable method was called."); e.Initialize( context, this, EventSeverity.Low, new LocalizedText(info), ServiceResult.IsGood(error), DateTime.UtcNow); e.SourceName.Value = "Attribute/Call"; e.MethodId = new PropertyState<NodeId>(e); e.MethodId.Value = method.NodeId; ReportEvent(context, e); } return error; }