Opc.Ua.ConditionState.ProcessBeforeAddComment C# (CSharp) 메소드

ProcessBeforeAddComment() 보호된 메소드

Does any processing before adding a comment to a condition.
protected ProcessBeforeAddComment ( ISystemContext context, byte eventId, Opc.Ua.LocalizedText comment ) : ServiceResult
context ISystemContext The system context.
eventId byte The identifier for the event which is the target for the comment.
comment Opc.Ua.LocalizedText The comment.
리턴 ServiceResult
        protected virtual ServiceResult ProcessBeforeAddComment(
            ISystemContext context, 
            byte[] eventId,
            LocalizedText comment)
        {
            if (eventId == null)
            {
                return StatusCodes.BadEventIdUnknown;
            }

            if (!this.EnabledState.Id.Value)
            {
                return StatusCodes.BadConditionDisabled;
            }

            if (OnAddComment != null)
            {
                try
                {
                    return OnAddComment(context, this, eventId, comment);
                }
                catch (Exception e)
                {
                    return ServiceResult.Create(e, StatusCodes.BadUnexpectedError, "Unexpected error adding a comment to a Condition.");
                }
            }

            return ServiceResult.Good;
        }