public void AssignTimestamp(XEvent evt, long time) { XAttributeTimestamp attr = (XAttributeTimestamp)ATTR_TIMESTAMP.Clone(); attr.ValueMillis = time; evt.GetAttributes().Add(QualifiedName(KEY_TIMESTAMP), attr); }
public void AssignLevel(XEvent evt, long level) { XAttributeDiscrete attr = (XAttributeDiscrete)ATTR_LEVEL.Clone(); attr.Value = level; evt.GetAttributes().Add(QualifiedName(KEY_LEVEL), attr); }
public void AssignLength(XEvent evt, long length) { XAttributeDiscrete attr = (XAttributeDiscrete)ATTR_LENGTH.Clone(); attr.Value = length; evt.GetAttributes().Add(QualifiedName(KEY_LENGTH), attr); }
public void AssignInstance(XEvent evt, string instance) { if ((instance != null) && (instance.Trim().Length > 0)) { XAttributeLiteral attr = (XAttributeLiteral)ATTR_INSTANCE.Clone(); attr.Value = instance; evt.GetAttributes().Add(QualifiedName(KEY_INSTANCE), attr); } }
public void assignRole(XEvent evt, String role) { if ((role != null) && (role.Trim().Length > 0)) { XAttributeLiteral attr = (XAttributeLiteral)ATTR_ROLE.Clone(); attr.Value = role.Trim(); evt.GetAttributes().Add(QualifiedName(KEY_ROLE), attr); } }
public void assignResource(XEvent evt, String resource) { if ((resource != null) && (resource.Trim().Length > 0)) { XAttributeLiteral attr = (XAttributeLiteral)ATTR_RESOURCE.Clone(); attr.Value = resource.Trim(); evt.GetAttributes().Add(QualifiedName(KEY_RESOURCE), attr); } }
public void assignGroup(XEvent evt, String group) { if ((group != null) && (group.Trim().Length > 0)) { XAttributeLiteral attr = (XAttributeLiteral)ATTR_GROUP.Clone(); attr.Value = group.Trim(); evt.GetAttributes().Add(QualifiedName(KEY_GROUP), attr); } }
public DateTime?ExtractTimestamp(XEvent evt) { try{ return(((XAttributeTimestamp)evt.GetAttributes()[QualifiedName(KEY_TIMESTAMP)]).Value); }catch (KeyNotFoundException) { XLogging.Log("Key '" + QualifiedName(KEY_TIMESTAMP) + "' not available", XLogging.Importance.WARNING); return(null); } }
public string ExtractTransition(XEvent evt) { XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_TRANSITION)]; if (attribute == null) { return(null); } return(((XAttributeLiteral)attribute).Value); }
public void AssignTransition(XEvent evt, string transition) { if ((transition != null) && (transition.Trim().Length > 0)) { XAttributeLiteral transAttr = (XAttributeLiteral)ATTR_TRANSITION.Clone(); transAttr.Value = transition.Trim(); evt.GetAttributes().Add(QualifiedName(KEY_TRANSITION), transAttr); } }
public String extractGroup(XEvent evt) { XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_GROUP)]; if (attribute == null) { return(null); } return(((XAttributeLiteral)attribute).Value); }
public String extractResource(XEvent evt) { XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_RESOURCE)]; if (attribute == null) { return(null); } return(((XAttributeLiteral)attribute).Value); }
public string ExtractInstance(XEvent evt) { try { return(((XAttributeLiteral)evt.GetAttributes()[QualifiedName(KEY_INSTANCE)]).Value); } catch (KeyNotFoundException) { XLogging.Log("Key '" + QualifiedName(KEY_INSTANCE) + "' not available", XLogging.Importance.WARNING); return(null); } }