public void InitialiseViews() { try { if (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 VMDirSchemaRootScopeNode(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.BindDN; this.Window.Title = VMDirSchemaConstants.VMDIRSCHEMA_APPNAME; VMDirSchemaSnapInEnvironment.Instance.LocalData.AddServer(serverNode.ServerDTO.Server); splitViewController.MainOutlineView.OutlineTableColumn.HeaderCell.Title = VMIdentityConstants.CONNECT_TO + serverNode.DisplayName; VMDirSchemaSnapInEnvironment.Instance.LocalData.AddServer(serverNode.ServerDTO.Server); //Assign delegates splitViewController.MainOutlineView.Delegate = new OutlineDelegate(this); splitViewController.MainTableView.Delegate = new TableDelegate(this); } else { throw new Exception(VMIdentityConstants.SERVER_CONNECT_ERROR); } } catch (Exception e) { UIErrorHelper.ShowAlert(string.Empty, e.Message); } }
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 VMDirSchemaAttributeBaseNode) { DisplayAttributesTableView(item); } else if (item is VMDirSchemaClassEntryNode) { DisplayClassAttributesTableView(item); } else if (item is VMDirSchemaClassBaseNode) { DisplayClassesTableView(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); VMDirSchemaRootScopeNode node = item as VMDirSchemaRootScopeNode; splitViewController.MainTableView.DataSource = new NodesListView(node.Children, null); } table.ReloadData(); } }); }