Exemplo n.º 1
0
 private void networkList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (networkList.SelectedIndex != -1)
     {
         networkProfileBox.Visible = true;
         NetworkProfile network = profiles[networkList.SelectedIndex];
         networkProfileBox.Text           = network.ProfileName;
         networkCategoryBox.SelectedIndex = (int)network.Category;
         networkProfileNameBox.Text       = network.ProfileName;
         networkCreatedLabel.Text         = network.DateCreated.ToString();
         networkLastConnectedLabel.Text   = network.DateLastConnected.ToString();
         networkDescriptionBox.Text       = network.Description;
     }
 }
Exemplo n.º 2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            if (networkProfileBox.Text.Length == 0)
            {
                MessageBox.Show("Profile name cannot be empty!");
                return;
            }

            NetworkProfile network = profiles[networkList.SelectedIndex];

            network.ProfileName = networkProfileBox.Text;
            network.Description = networkDescriptionBox.Text;
            network.Category    = (NetworkCategory)networkCategoryBox.SelectedIndex;
            network.Save();
            MessageBox.Show("Network profile saved.\nYou may need to log-in and out again.");
        }
Exemplo n.º 3
0
 private void RefreshNetworkList()
 {
     networkList.Items.Clear();
     profiles = NetworkProfile.ListNetworkProfiles();
     profiles.ForEach(a => networkList.Items.Add(a.ProfileName));
 }
Exemplo n.º 4
0
 public MainForm()
 {
     InitializeComponent();
     profiles = NetworkProfile.ListNetworkProfiles();
     profiles.ForEach(a => networkList.Items.Add(a.ProfileName));
 }