public virtual void Initialize(
ISystemContext context,
NodeState source,
EventSeverity severity,
LocalizedText message)
{
m_eventId = new PropertyState<byte[]>(this);
m_eventId.Value = Guid.NewGuid().ToByteArray();
m_eventType = new PropertyState<NodeId>(this);
m_eventType.Value = GetDefaultTypeDefinitionId(context.NamespaceUris);
TypeDefinitionId = m_eventType.Value;
if (source != null)
{
if (!NodeId.IsNull(source.NodeId))
{
m_sourceNode = new PropertyState<NodeId>(this);
m_sourceNode.Value = source.NodeId;
}
if (!QualifiedName.IsNull(source.BrowseName))
{
m_sourceName = new PropertyState<string>(this);
m_sourceName.Value = source.BrowseName.Name;
}
}
m_time = new PropertyState<DateTime>(this);
m_time.Value = DateTime.UtcNow;
m_receiveTime = new PropertyState<DateTime>(this);
m_receiveTime.Value = DateTime.UtcNow;
m_severity = new PropertyState<ushort>(this);
m_severity.Value = (ushort)severity;
m_message = new PropertyState<LocalizedText>(this);
m_message.Value = message;
}
#endregion