예제 #1
0
        void PacketReceived(object sender, PacketReceivedEventArgs e)
        {
            var packet = new Packet(DateTime.Now, e.Address, e.Port, e.Contents);

            var packetViewModel = new PacketRowViewModel(packet);

            DispatcherHelper.CheckBeginInvokeOnUI(() => _packets.Add(packetViewModel));

            if (_logWriter != null)
            {
                _logWriter.WriteLine("{0},\"{1}\",{2},\"{3}\"", packetViewModel.Timestamp, packetViewModel.Source, packetViewModel.Content.Length, packetViewModel.Content.Replace("\"", "\"\""));
            }
        }
예제 #2
0
        void PacketReceived(object sender, PacketReceivedEventArgs e)
        {
            var packet = new Packet(DateTime.Now, e.Address, e.Port, e.Contents);

            var packetViewModel = new PacketRowViewModel(packet);

            DispatcherHelper.CheckBeginInvokeOnUI(() => _packets.Add(packetViewModel));

            if (_logWriter != null)
            {
                _logWriter.WriteLine("{0},\"{1}\",{2},\"{3}\"", packetViewModel.Timestamp, packetViewModel.Source, packetViewModel.Content.Length, packetViewModel.Content.Replace("\"", "\"\""));
            }
        }