Ejemplo n.º 1
0
        private void session_NewTransactionNode(TransactionNode node)
        {
            string id = Convert.ToString(nodes.Count);

            PropertySpec propSpec = new PropertySpec(id, node.GetType(), "Packet");
            propSpec.Description = node.Name;
            propSpec.Attributes = new Attribute[1] { new ReadOnlyAttribute(true) };
            Properties.Add(propSpec);
            this[id] = node;

            nodes.Add(node);

            List<IPPacket> packets = new List<IPPacket>();
            foreach (PacketSlice slice in node.GetAllSlices())
            {
                if (!packetIndexToNodes.ContainsKey(slice.Packet.Index))
                    packetIndexToNodes[slice.Packet.Index] = new List<TransactionNode>(1);

                packetIndexToNodes[slice.Packet.Index].Add(node);

                if (!packets.Contains(slice.Packet))
                    packets.Add(slice.Packet);
            }

            PacketDescriptionReceived(packets.ToArray(),
                (node.Description.Length > 0) ? node.Description : node.Name);
        }