コード例 #1
0
ファイル: StreamingAcnSnoop.cs プロジェクト: Farrser/ACN
 void cell_Click(object sender, EventArgs e)
 {
     ChannelCell cell = sender as ChannelCell;
     if (cell != null)
     {
         SelectedChannel = cell;
     }
 }
コード例 #2
0
        public StreamingAcnSnoop()
        {
            InitializeComponent();
            SetupGrid();

            for (int n = 1; n <= 512; n++)
            {
                ChannelCell receiveCell = new ChannelCell(n, receiveData);
                receiveCell.Width  = 60;
                receiveCell.Margin = new Padding(3);

                channelArea.Controls.Add(receiveCell);

                ChannelCell cell = new ChannelCell(n, sendData);
                cell.Width  = 60;
                cell.Margin = new Padding(3);

                cell.Click += new EventHandler(cell_Click);

                sendChannelArea.Controls.Add(cell);
            }

            CardInfo firstCard = null;

            foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (adapter.SupportsMulticast && adapter.OperationalStatus == OperationalStatus.Up)
                {
                    IPInterfaceProperties ipProperties = adapter.GetIPProperties();

                    for (int n = 0; n < ipProperties.UnicastAddresses.Count; n++)
                    {
                        CardInfo card = new CardInfo(adapter, n);
                        if (card.IpAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                        {
                            networkCardSelect.Items.Add(card);

                            if (firstCard == null)
                            {
                                firstCard = card;
                            }
                        }
                    }
                }
            }

            if (firstCard != null)
            {
                Start(firstCard, ((IEnumerable <int>) new int[] { int.Parse(toolStripTextBox1.Text) }));
            }
        }