Пример #1
0
            public ChannelListViewItem(IChannel channel, ChannelListView listView) : base(channel.Name, "dynamic channel", listView.Groups["dynamic"])
            {
                this.name           = channel.Name;
                this.dynamicChannel = true;

                endpoint = null;
                if (channel is UDPChannel)
                {
                    UDPChannel udpChannel = (UDPChannel)channel;
                    endpoint = new IPEndPoint(udpChannel.IP, udpChannel.Port);

                    listener = new ChannelListener(endpoint, ChannelType.UDPChannel);
                }

                this.SubItems.Add(endpoint == null ? channel.GetType().Name : endpoint.ToString());
                this.SubItems.Add("");
                this.SubItems.Add("");
            }
Пример #2
0
            public void UpdateListenerData()
            {
                if (this.ListView != null && listener != null)
                {
                    ChannelListView channelListView = (ChannelListView)this.ListView;

                    if (listener.HasData)
                    {
                        double packetRate = listener.PacketRate;
                        double byteRate   = listener.ByteRate;
                        string senders    = listener.GetSendersString();

                        this.SubItems[channelListView.columnPacketRate.DisplayIndex].Text = string.Format("{0:F1}/{1:F1}", packetRate, byteRate);
                        this.SubItems[channelListView.columnSenders.DisplayIndex].Text    = senders;
                    }
                    else
                    {
                        this.SubItems[channelListView.columnPacketRate.DisplayIndex].Text = string.Empty;
                        this.SubItems[channelListView.columnSenders.DisplayIndex].Text    = string.Empty;
                    }
                }
            }
            public ChannelListViewItem(string name, IPEndPoint endpoint, ChannelType channelType, ChannelListView listView)
                : base(name, "static channel", listView.Groups["static"])
            {
                this.name = name;
                this.dynamicChannel = false;

                this.endpoint = endpoint;
                this.listener = new ChannelListener(endpoint, channelType);

                this.SubItems.Add(endpoint == null ? "unknown" : endpoint.ToString());
                this.SubItems.Add("");
                this.SubItems.Add("");
            }
            public ChannelListViewItem(IChannel channel, ChannelListView listView)
                : base(channel.Name, "dynamic channel", listView.Groups["dynamic"])
            {
                this.name = channel.Name;
                this.dynamicChannel = true;

                endpoint = null;
                if (channel is UDPChannel) {
                    UDPChannel udpChannel = (UDPChannel)channel;
                    endpoint = new IPEndPoint(udpChannel.IP, udpChannel.Port);

                    listener = new ChannelListener(endpoint, ChannelType.UDPChannel);
                }

                this.SubItems.Add(endpoint == null ? channel.GetType().Name : endpoint.ToString());
                this.SubItems.Add("");
                this.SubItems.Add("");
            }
Пример #5
0
            public ChannelListViewItem(string name, IPEndPoint endpoint, ChannelType channelType, ChannelListView listView)
                : base(name, "static channel", listView.Groups["static"])
            {
                this.name           = name;
                this.dynamicChannel = false;

                this.endpoint = endpoint;
                this.listener = new ChannelListener(endpoint, channelType);

                this.SubItems.Add(endpoint == null ? "unknown" : endpoint.ToString());
                this.SubItems.Add("");
                this.SubItems.Add("");
            }