示例#1
0
        public virtual void PerformDelete()
        {
            ConfirmationDialogController cwc = new ConfirmationDialogController("Are you sure?");
            nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window);

            if (result == (nint)VMIdentityConstants.DIALOGOK)
            {
                UIErrorHelper.CheckedExec(delegate()
                {
                    ServerDTO.Connection.DeleteObject(Dn);
                    ScopeNode node = this.Parent;
                    if (node != null)
                    {
                        node.Children.Remove(this);
                        if (node is DirectoryNode)
                        {
                            (node as DirectoryNode).ReloadChildren();
                        }
                        NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadOutlineView", node);
                        NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadTableView", node);
                        UIErrorHelper.ShowInformation(VMDirConstants.STAT_OBJ_DEL_SUCC);
                    }
                    else
                    {
                        UIErrorHelper.ShowInformation(VMDirConstants.STAT_BASE_OBJ_DEL_SUCC);
                    }
                });
            }
        }
示例#2
0
        public void PerformDelete()
        {
            ConfirmationDialogController cwc = new ConfirmationDialogController("Are you sure?");
            nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window);

            if (result == (nint)VMIdentityConstants.DIALOGOK)
            {
                UIErrorHelper.CheckedExec(delegate() {
                    ServerDTO.Connection.DeleteObject(Name);
                    ScopeNode node = this.Parent;
                    if (node != null)
                    {
                        node.Children.Remove(this);
                        if (node is DirectoryNode)
                        {
                            (node as DirectoryNode).ReloadChildren();
                        }
                        NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadOutlineView", node);
                        NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadTableView", node);
                        UIErrorHelper.ShowAlert("", "Successfully deleted object");
                    }
                    else
                    {
                        UIErrorHelper.ShowAlert("", "Deleted base object. Please Refresh the Server");
                    }
                });
            }
        }
示例#3
0
 public DirectoryNode (string dn, VMDirServerDTO dto, ScopeNode parent) : base (dto)
 {
     Name = dn;
     DisplayName = VMDirServerDTO.DN2CN (Name);
     Parent = parent;
     IsBaseNode = false;
     _properties = new Dictionary<string, VMDirBagItem> ();
 }
示例#4
0
 public DirectoryNode(string dn, VMDirServerDTO dto, ScopeNode parent) : base(dto)
 {
     Name        = dn;
     DisplayName = VMDirServerDTO.DN2CN(Name);
     Parent      = parent;
     IsBaseNode  = false;
     _properties = new Dictionary <string, VMDirBagItem> ();
 }
示例#5
0
 public DirectoryNode(string dn, List <string> ocSet, VMDirServerDTO dto, ScopeNode parent) : base(dto)
 {
     Dn          = dn;
     ObjectClass = ocSet;
     DisplayName = VMDirServerDTO.DN2CN(Dn);
     Parent      = parent;
     IsBaseNode  = false;
     InitPageSearch();
 }
示例#6
0
 public ScopeNode ChildAtIndex(int n)
 {
     if (this.Children != null && n < NumberOfChildren())
     {
         ScopeNode item = this.Children [n];
         return(item);
     }
     else
     {
         return(null);
     }
 }
 public OutlineViewDataSource (DirectoryNode node) : base ()
 {
     RootNode = node;
 }