private void ResetViews () { if (MainOutlineView != null) { MainOutlineView.DataSource = null; if (outlineViewDataSource.RootNode.Children != null) outlineViewDataSource.RootNode.Children.Clear (); outlineViewDataSource = null; MainOutlineView.OutlineTableColumn.HeaderCell.Title = string.Empty; } if (MainTableView != null) { RemoveTableColumns (); MainTableView.DataSource = null; } Window.Title = "Lightwave Directory"; StatusLabel.StringValue = "Logged in : none"; NSNotificationCenter.DefaultCenter.PostNotificationName ("ReloadOutlineView", this); NSNotificationCenter.DefaultCenter.PostNotificationName ("ReloadTableView", this); SetToolBarState (false); }
private void InitialiseViews () { AppDelegate appDelegate = NSApplication.SharedApplication.Delegate as AppDelegate; appDelegate.OpenConnectionMenuITem.Hidden = true; try { if (serverNode.IsLoggedIn) { InitialiseDefaultOutlineView (); VMDirSnapInEnvironment.Instance.LocalData.AddServer (serverNode.DTO.Server); DirectoryNode baseNode = new DirectoryNode (serverNode.DTO.BaseDN, serverNode.DTO, null); baseNode.IsBaseNode = true; outlineViewDataSource = new OutlineViewDataSource (baseNode); splitViewController.MainOutlineView.DataSource = outlineViewDataSource; baseNode.PopulateChildren (serverNode.DTO.BaseDN); SetToolBarState (true); InitialiseDefaultTableView (); StatusLabel.StringValue = "Logged in : " + serverNode.DTO.BindDN; } else UIErrorHelper.ShowAlert ("Please check your server details and credentials.", "Login not successful!"); } catch (Exception e) { CloseConnection (); UIErrorHelper.ShowAlert (e.Message, "Error in populating the directory. Please check the login details and try again"); } }