Esempio n. 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (var dlg = new RightEditDialog())
         if (dlg.ShowDialog() == DialogResult.OK && !UserExists(dlg.UserId))
         {
             edited = true;
             AddRightToList(dlg.UserId, dlg.UserName, dlg.EnableProxies);
             btnOK.Enabled = true;
         }
 }
Esempio n. 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            ListViewItem item = listViewRights.SelectedItems[0];

            using (var dlg = new RightEditDialog(item.Text, (bool)item.SubItems[1].Tag))
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    item.SubItems[1].Tag  = dlg.EnableProxies;
                    item.SubItems[1].Text = dlg.EnableProxies ? Environment.StringResources.GetString("Yes") : Environment.StringResources.GetString("No");
                    btnOK.Enabled         = true;
                    edited = true;
                }
        }