Ejemplo n.º 1
0
        private void DisplayData(MyIp ip, IpMask mask)
        {
            var brAdr  = ip.GetBroadcastAdress(mask);
            var netAdr = ip.GetNetworkAdress(mask);
            var l      = new ObservableCollection <Representation>
            {
                new Representation {
                    Name = "Ip adress", BinaryValue = ip.BinaryView(), Value = ip.ToString()
                },
                new Representation {
                    Name = "Mask", BinaryValue = mask.BinaryView(), Value = mask.ToString()
                },
                new Representation {
                    Name = "Broadcast adress", BinaryValue = brAdr.BinaryView(), Value = brAdr.ToString()
                },
                new Representation {
                    Name = "Network adress", BinaryValue = netAdr.BinaryView(), Value = netAdr.ToString()
                },
            };

            IpRepresentationListView.ItemsSource = l;
            IpClassTextBox.Text      = ip.GetIpClass();
            IpClassTextBox.IsEnabled = true;
            CountTextBox.Text        = mask.GetNetworkCapacity().ToString();
            CountTextBox.IsEnabled   = true;
        }