コード例 #1
0
        /// <summary>
        /// Reports an audit event for the cause.
        /// </summary>
        protected virtual void ReportAuditEvent(OperationContext context, Transition transition, QualifiedName cause, Exception exception)
        {
            AuditUpdateStateEvent e = CreateAuditEvent(context, transition, cause, exception);

            e.InitializeNewEvent();

            e.Message.Value         = Utils.Format("Method {0} was called.", cause);
            e.SourceNode.Value      = NodeId;
            e.SourceName.Value      = "Method/Call";
            e.Severity.Value        = 1;
            e.ReceiveTime.Value     = DateTime.UtcNow;
            e.ActionTimeStamp.Value = DateTime.UtcNow;
            e.OldStateId.Value      = m_currentStateName.StateNumber;
            e.NewStateId.Value      = m_currentStateName.StateNumber;

            if (context != null)
            {
                e.ClientAuditEntryId.Value = context.AuditEntryId;
                e.ClientUserId.Value       = context.Session.Identity.DisplayName;
            }

            if (transition != null)
            {
                e.OldStateId.Value = transition.FromState.StateNumber;
                e.NewStateId.Value = transition.ToState.StateNumber;
            }

            ReportEvent(e);
        }
コード例 #2
0
 /// <summary>
 /// Creates an audit event for the cause.
 /// </summary>
 protected virtual AuditUpdateStateEvent CreateAuditEvent(
     OperationContext context,
     Transition transition,
     QualifiedName cause,
     Exception exception)
 {
     return(AuditUpdateStateEvent.Construct(Server));
 }