Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #9
0
        public string ExtractTransition(XEvent evt)
        {
            XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_TRANSITION)];

            if (attribute == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attribute).Value);
        }
Пример #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);
            }
        }
Пример #11
0
        public String extractGroup(XEvent evt)
        {
            XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_GROUP)];

            if (attribute == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attribute).Value);
        }
Пример #12
0
        public String extractResource(XEvent evt)
        {
            XAttribute attribute = evt.GetAttributes()[QualifiedName(KEY_RESOURCE)];

            if (attribute == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attribute).Value);
        }
Пример #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);
     }
 }