public MainWindowController (ServerDto serverDto) : base ("MainWindow")
 {
     _serverDto = serverDto;
     Servernode = new ServerNode (_serverDto);
     navigationController = new OutlineViewNavigationController ();
 }
 public void ConnectToNewServer ()
 {
     var form = new AddNewServerController (){ ServerDto = _serverDto };
     NSApplication.SharedApplication.BeginSheet (form.Window, this.Window, () => {
     });
     try {
         nint result = NSApplication.SharedApplication.RunModalForWindow (form.Window);
         if (result == VMIdentityConstants.DIALOGOK) {
             _serverDto = form.ServerDto;
             Servernode = new ServerNode (_serverDto);
             Servernode.IsLoggedIn = false;
             Servernode.LoginDto = form.LoginDto;
             Servernode.Login ();
         }
     } finally {
         Window.EndSheet (form.Window);
         form.Close ();
         form.Dispose ();
     }
     if (Servernode != null && Servernode.IsLoggedIn)
         InitialiseViews ();
     else
         ResetToolBarItems ();
 }