예제 #1
0
        public bool TryDeserialize(XElement elt, out Event ret)
        {
            ret = null;
            switch (elt.Name.LocalName)
            {
            case SC.Elt_Procedure:
                ret = new ProcedureEvent(
                    MakeTrigger(elt), Attr(elt, SC.Attr_DisplayName), Attr(elt, SC.Attr_ActivityId), ActivityEventType(elt, SC.Attr_Type),
                    status: Status(elt, SC.Attr_Status));
                break;

            case SC.Elt_Lifetime:
                ret = new ObjectLifetimeEvent(
                    MakeTrigger(elt), Attr(elt, SC.Attr_DisplayName), Attr(elt, SC.Attr_ActivityId), ActivityEventType(elt, SC.Attr_Type));
                break;

            case SC.Elt_NetworkMessage:
                ret = new NetworkMessageEvent(
                    MakeTrigger(elt), Attr(elt, SC.Attr_DisplayName), Attr(elt, SC.Attr_ActivityId),
                    ActivityEventType(elt, SC.Attr_Type), NetworkMessageDirection(elt, SC.Attr_Direction),
                    status: Status(elt, SC.Attr_Status));
                break;

            case SC.Elt_UserAction:
                ret = new UserActionEvent(
                    MakeTrigger(elt), Attr(elt, SC.Attr_DisplayName));
                break;

            case SC.Elt_APICall:
                ret = new APICallEvent(
                    MakeTrigger(elt), Attr(elt, SC.Attr_DisplayName));
                break;

            case SC.Elt_EOF:
                ret = new EndOfTimelineEvent(
                    MakeTrigger(elt), Attr(elt, SC.Attr_DisplayName));
                break;
            }
            if (ret != null)
            {
                ret.Tags = tagsPool.Intern(
                    new HashSet <string>((Attr(elt, SC.Attr_Tags) ?? "").Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)));
                ReadPhases(elt, ret);
            }
            return(ret != null);
        }
예제 #2
0
 void IEventsVisitor.Visit(NetworkMessageEvent evt)
 {
     HandleActivityEvent(evt, ToNetworkActivityType(evt.Direction), evt.ActivityId);
 }
예제 #3
0
        void IEventsVisitor.Visit(NetworkMessageEvent evt)
        {
            var e = CreateActivityElement(evt, SC.Elt_NetworkMessage);

            e.SetAttributeValue(SC.Attr_Direction, (int)evt.Direction);
        }
예제 #4
0
 void IEventsVisitor.Visit(NetworkMessageEvent evt)
 {
     Output.AppendFormat("NetworkRequest: {0}", evt.DisplayName);
 }