예제 #1
0
 private void AddACL(AccessControlList acl)
 {
     VGen0 method = null;
     TreeNode aclNode = new TreeNode(acl.Name, 0, 0);
     aclNode.Name = acl.Name;
     aclNode.Tag = acl;
     foreach (AccessControlListMember member in acl.Members)
     {
         TreeNode node = new TreeNode(member.MemberName, 1, 1);
         node.Tag = member;
         aclNode.Nodes.Add(node);
     }
     if ((base.InvokeRequired && !base.Disposing) && !base.IsDisposed)
     {
         if (method == null)
         {
             method = delegate {
                 this.treeViewACL.Nodes.Add(aclNode);
             };
         }
         base.Invoke(method);
     }
     else if (!(base.Disposing || base.IsDisposed))
     {
         this.treeViewACL.Nodes.Add(aclNode);
     }
 }
예제 #2
0
 public DlgAddMember(AccessControlList acl)
 {
     this.InitializeComponent();
     this.mACL = acl;
     this.comboBoxInclusionType.Items.Add(new MultiVal<string, InclusionTypes>("Include", InclusionTypes.Include));
     this.comboBoxInclusionType.Items.Add(new MultiVal<string, InclusionTypes>("Exclude", InclusionTypes.Exclude));
     this.comboBoxInclusionType.Items.Add(new MultiVal<string, InclusionTypes>("Member Defined", InclusionTypes.MemberDefined));
     this.comboBoxInclusionType.SelectedIndex = 0;
     if (acl.InclusionType == InclusionTypes.MemberDefined)
     {
         this.comboBoxInclusionType.Enabled = true;
     }
     else
     {
         this.comboBoxInclusionType.Enabled = false;
     }
 }
예제 #3
0
 public static bool GetByName(string name, out AccessControlList acl)
 {
     acl = GetByName(name);
     return (acl != null);
 }
예제 #4
0
 public static bool GetByID(int id, out AccessControlList acl)
 {
     acl = GetByID(id);
     return (acl != null);
 }
예제 #5
0
 private void skinButtonOK_Click(object sender, EventArgs e)
 {
     base.ClearErrors();
     string text = this.gpgTextAreaDescription.Text;
     string name = this.gpgTextBoxName.Text;
     if ((name == null) || (name.Length < 1))
     {
         base.Error(this.gpgTextBoxName, "Field cannot be blank", new object[0]);
     }
     else
     {
         AccessControlListTypes listType = (this.comboBoxListType.SelectedItem as MultiVal<string, AccessControlListTypes>).Value2;
         string tag = this.gpgTextBoxQueryName.Text;
         if ((listType == AccessControlListTypes.QueriedList) && ((tag == null) || (tag.Length < 1)))
         {
             base.Error(this.gpgTextBoxQueryName, "Field cannot be blank", new object[0]);
         }
         else
         {
             if (listType != AccessControlListTypes.QueriedList)
             {
                 tag = "";
             }
             InclusionTypes inclusionType = (this.comboBoxInclusionType.SelectedItem as MultiVal<string, InclusionTypes>).Value2;
             int access = (int) this.numericUpDownAccessLevel.Value;
             this.mACL = AccessControlList.Create(name, text, listType, inclusionType, access, tag);
             if (this.ACL == null)
             {
                 base.Error(this.skinButtonOK, "An error occured creating ACL", new object[0]);
             }
             else
             {
                 base.DialogResult = DialogResult.OK;
                 base.Close();
             }
         }
     }
 }
예제 #6
0
 private void treeViewACL_AfterSelect(object sender, TreeViewEventArgs e)
 {
     this.mSelectedACL = null;
     this.mSelectedMember = null;
     if (e.Node != null)
     {
         if (e.Node.Tag is AccessControlList)
         {
             this.mSelectedACL = e.Node.Tag as AccessControlList;
         }
         else if (e.Node.Tag is AccessControlListMember)
         {
             this.mSelectedMember = e.Node.Tag as AccessControlListMember;
             this.mSelectedACL = e.Node.Parent.Tag as AccessControlList;
         }
     }
 }
예제 #7
0
 private void skinButtonClear_Click(object sender, EventArgs e)
 {
     this.mSelectedACL = null;
     this.mSelectedMember = null;
     base.DialogResult = DialogResult.OK;
     base.Close();
 }
예제 #8
0
 private void treeViewACL_AfterSelect(object sender, TreeViewEventArgs e)
 {
     this.SelectedACL = null;
     this.SelectedMember = null;
     if (e.Node != null)
     {
         if (e.Node.Tag is AccessControlList)
         {
             this.SelectedACL = e.Node.Tag as AccessControlList;
             this.BindToSelectedACL();
         }
         else if (e.Node.Tag is AccessControlListMember)
         {
             this.SelectedMember = e.Node.Tag as AccessControlListMember;
             this.SelectedACL = e.Node.Parent.Tag as AccessControlList;
             this.BindToSelectedMember();
             this.BindToSelectedACL();
         }
         else
         {
             this.gpgLabelNoSelection.BringToFront();
         }
     }
 }