示例#1
0
 void IEventsVisitor.Visit(FunctionInvocationEvent evt)
 {
     CreateElement(evt, SC.Elt_Function,
                   new XAttribute(SC.Attr_MessageDirection, (int)evt.MessageDirection),
                   new XAttribute(SC.Attr_MessageType, (int)evt.MessageType),
                   new XAttribute(SC.Attr_MessageId, evt.InvocationId));
 }
示例#2
0
 void IEventsVisitor.Visit(FunctionInvocationEvent evt)
 {
     Output.AppendFormat("Function: {0}", evt.DisplayName ?? evt.InvocationId);
 }
示例#3
0
        public bool TryDeserialize(XElement elt, out Event ret)
        {
            ret = null;
            switch (elt.Name.LocalName)
            {
            case SC.Elt_HttpMessage:
                ret = new HttpMessage(
                    MakeTrigger(elt),
                    Attr(elt, SC.Attr_DisplayName),
                    MessageDirection(elt, SC.Attr_MessageDirection),
                    MessageType(elt, SC.Attr_MessageType),
                    Attr(elt, SC.Attr_MessageId),
                    Attr(elt, SC.Attr_Remote),
                    Attr(elt, SC.Attr_Method),
                    "",
                    Enumerable.Empty <KeyValuePair <string, string> >(),
                    StatusCode(elt, SC.Attr_StatusCode),
                    targetIdHint: Attr(elt, SC.Attr_TargetId),
                    statusComment: Attr(elt, SC.Attr_StatusComment)
                    );
                break;

            case SC.Elt_NetworkMessage:
                ret = new NetworkMessageEvent(
                    MakeTrigger(elt),
                    Attr(elt, SC.Attr_DisplayName),
                    MessageDirection(elt, SC.Attr_MessageDirection),
                    MessageType(elt, SC.Attr_MessageType),
                    typesPool.Intern(Attr(elt, SC.Attr_EventType)),
                    Attr(elt, SC.Attr_MessageId),
                    Attr(elt, SC.Attr_TargetId),
                    remoteNodeIdsPool.Intern(Attr(elt, SC.Attr_Remote))
                    );
                break;

            case SC.Elt_ResponselessNetworkMessage:
                ret = new ResponselessNetworkMessageEvent(
                    MakeTrigger(elt),
                    Attr(elt, SC.Attr_DisplayName),
                    MessageDirection(elt, SC.Attr_MessageDirection),
                    MessageType(elt, SC.Attr_MessageType),
                    messageId: Attr(elt, SC.Attr_MessageId),
                    targetIdHint: Attr(elt, SC.Attr_TargetId)
                    );
                break;

            case SC.Elt_Cancellation:
                ret = new RequestCancellationEvent(
                    MakeTrigger(elt),
                    Attr(elt, SC.Attr_DisplayName),
                    Attr(elt, SC.Attr_MessageId)
                    );
                break;

            case SC.Elt_Function:
                ret = new FunctionInvocationEvent(
                    MakeTrigger(elt),
                    Attr(elt, SC.Attr_DisplayName),
                    MessageDirection(elt, SC.Attr_MessageDirection),
                    MessageType(elt, SC.Attr_MessageType),
                    Attr(elt, SC.Attr_MessageId)
                    );
                break;

            case SC.Elt_Meta:
                ret = new MetadataEvent(
                    MakeTrigger(elt),
                    Attr(elt, SC.Attr_MetaKey),
                    Attr(elt, SC.Attr_MetaValue)
                    );
                break;
            }
            if (ret != null)
            {
                ret.Tags = tagsPool.Intern(
                    new HashSet <string>((Attr(elt, SC.Attr_Tags) ?? "").Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)));
                ret.Status = EventStatus(elt, SC.Attr_Status);
            }
            return(ret != null);
        }