private void Button_Click(object sender, RoutedEventArgs e)
 {
     NetworkInfo Info = new NetworkInfo();
     try
     {
         Info.NumberOfHosts = int.Parse(NumberOfHostsTextBox.Text);
         Info.RequiredSubnets = int.Parse(RequiredSubnetsTextBox.Text);
         Info.SampleAddress = SampleAddressTextBox.Text;
         NetworkBuilder Builder = new NetworkBuilder(Info);
         SubnettingOutput Window = new SubnettingOutput(Builder.BuiltNetwork);
         Window.Show();
     }
     catch (Exception)
     {
         Helpers.MessageBox MessageBox = new Helpers.MessageBox("There was an error parsing your information");
         MessageBox.Show();
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            NetworkInfo Info = new NetworkInfo();

            try
            {
                Info.NumberOfHosts   = int.Parse(NumberOfHostsTextBox.Text);
                Info.RequiredSubnets = int.Parse(RequiredSubnetsTextBox.Text);
                Info.SampleAddress   = SampleAddressTextBox.Text;
                NetworkBuilder   Builder = new NetworkBuilder(Info);
                SubnettingOutput Window  = new SubnettingOutput(Builder.BuiltNetwork);
                Window.Show();
            }
            catch (Exception)
            {
                Helpers.MessageBox MessageBox = new Helpers.MessageBox("There was an error parsing your information");
                MessageBox.Show();
            }
        }
Exemple #3
0
        private void AndValues_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string IpAddressInput  = IpAddressTextBox.Text;
                string SubnetmaskInput = SubnetMaskTextBox.Text;

                Ander AddressAnder = new Ander();

                IpAddress  InputIpAddress = new IpAddress(IpAddressInput);
                SubnetMask InputNetmask   = new SubnetMask(SubnetmaskInput);

                IpAddress AndedAddress = AddressAnder.AndAddress(InputIpAddress, InputNetmask);

                OutputTextBox.Text = AndedAddress.ToString();
            }
            catch (Exception)
            {
                Helpers.MessageBox MessageBox = new Helpers.MessageBox("Invalid input");
                MessageBox.Show();
            }
        }
        private void AndValues_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string IpAddressInput = IpAddressTextBox.Text;
                string SubnetmaskInput = SubnetMaskTextBox.Text;

                Ander AddressAnder = new Ander();

                IpAddress InputIpAddress = new IpAddress(IpAddressInput);
                SubnetMask InputNetmask = new SubnetMask(SubnetmaskInput);

                IpAddress AndedAddress = AddressAnder.AndAddress(InputIpAddress, InputNetmask);

                OutputTextBox.Text = AndedAddress.ToString();
            }
            catch (Exception)
            {
                Helpers.MessageBox MessageBox = new Helpers.MessageBox("Invalid input");
                MessageBox.Show();
            }
        }