Exemplo n.º 1
0
        public void AssignTimestamp(XEvent evt, long time)
        {
            XAttributeTimestamp attr = (XAttributeTimestamp)ATTR_TIMESTAMP.Clone();

            attr.ValueMillis = time;
            evt.GetAttributes().Add(QualifiedName(KEY_TIMESTAMP), attr);
        }
Exemplo n.º 2
0
        public void AssignLevel(XEvent evt, long level)
        {
            XAttributeDiscrete attr = (XAttributeDiscrete)ATTR_LEVEL.Clone();

            attr.Value = level;
            evt.GetAttributes().Add(QualifiedName(KEY_LEVEL), attr);
        }
Exemplo n.º 3
0
        public void AssignLength(XEvent evt, long length)
        {
            XAttributeDiscrete attr = (XAttributeDiscrete)ATTR_LENGTH.Clone();

            attr.Value = length;
            evt.GetAttributes().Add(QualifiedName(KEY_LENGTH), attr);
        }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
 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);
     }
 }
Exemplo n.º 7
0
 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);
     }
 }
Exemplo n.º 8
0
 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);
     }
 }
Exemplo n.º 9
0
        public string ExtractTransition(XEvent evt)
        {
            XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_TRANSITION)];

            if (attribute == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attribute).Value);
        }
Exemplo n.º 10
0
        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);
            }
        }
Exemplo n.º 11
0
        public String extractGroup(XEvent evt)
        {
            XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_GROUP)];

            if (attribute == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attribute).Value);
        }
Exemplo n.º 12
0
        public String extractResource(XEvent evt)
        {
            XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_RESOURCE)];

            if (attribute == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attribute).Value);
        }
Exemplo n.º 13
0
 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);
     }
 }