Exemplo n.º 1
0
 public void RefreshTableViewsBasedOnSelection(nint row)
 {
     UIErrorHelper.CheckedExec(delegate()
     {
         if (row >= (nint)0)
         {
             NSObject item     = splitViewController.MainOutlineView.ItemAtRow((int)row);
             NSTableView table = splitViewController.MainTableView;
             RemoveTableColumns();
             if (item is VMDNSForwardZonesNode || item is VMDNSReverseZonesNode)
             {
                 DisplayZoneDetails(item);
             }
             else if (item is VMDNSZoneEntryNode)
             {
                 DisplayRecordDetails(item);
             }
             else
             {
                 //Display root node children
                 NSTableColumn col    = new NSTableColumn(VMIdentityConstants.NAME_FIELD);
                 col.HeaderCell.Title = VMIdentityConstants.NAME_FIELD;
                 col.DataCell         = new NSBrowserCell();
                 col.Width            = 160;
                 table.AddColumn(col);
                 VMDNSRootScopeNode node = item as VMDNSRootScopeNode;
                 splitViewController.MainTableView.DataSource = new NodesListView(node.Children, null);
             }
             table.ReloadData();
         }
     });
 }
Exemplo n.º 2
0
 public VMDNSZoneEntryNode(VmDnsZone zone, VMDNSServerNode node, VMDNSRootScopeNode parent)
     : base(node)
 {
     this.DisplayName = zone.Name;
     this.CurrentZone = zone;
     this.Parent      = parent;
 }
Exemplo n.º 3
0
        public override void InitialiseViews()
        {
            try
            {
                serverNode.IsLoggedIn = true;
                SetToolBarState(true);
                //AppDelegate appDelegate = NSApplication.SharedApplication.Delegate as AppDelegate;
                //appDelegate.OpenConnectionMenuItem.Hidden = true;

                //assign datasources and prepare TableView and OutlineView
                rootNode = new VMDNSRootScopeNode(serverNode);
                outlineViewDataSource = new OutlineViewDataSource(rootNode);
                rootNode.AddChildren();
                splitViewController.MainOutlineView.DataSource                  = outlineViewDataSource;
                splitViewController.MainOutlineView.Activated                  += OnOutlineViewActivated;
                splitViewController.MainOutlineView.SelectionDidChange         += OnOutlineViewActivated;
                splitViewController.MainOutlineView.OutlineTableColumn.DataCell = new NSBrowserCell();

                splitViewController.MainTableView.DoubleClick   += OnDoubleClickedTableView;
                splitViewController.MainOutlineView.DoubleClick += OnDoubleClickedOutlineView;

                this.LoggedInLabel.StringValue = VMIdentityConstants.LOGGED_IN + serverNode.ServerDTO.UserName;
                this.Window.Title = VMDNSConstants.VMDNS_APPNAME;

                VMDNSSnapInEnvironment.Instance.LocalData.AddServer(serverNode.ServerDTO.Server);

                splitViewController.MainOutlineView.OutlineTableColumn.HeaderCell.Title = VMIdentityConstants.CONNECT_TO + "DNS Server";


                VMDNSSnapInEnvironment.Instance.LocalData.AddServer(serverNode.ServerDTO.Server);

                //Assign delegates
                splitViewController.MainOutlineView.Delegate = new OutlineDelegate(this);
                splitViewController.MainTableView.Delegate   = new TableDelegate(this);
            }
            catch (Exception e)
            {
                UIErrorHelper.ShowAlert(string.Empty, e.Message);
            }
        }