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;
}