private void btnCreate_Click(object sender, EventArgs e)
 {
     if (IsValid())
     {
         var adJoinInfoDto = ViewToDto();
         var auths         = SnapInContext.Instance.AuthTokenManager.GetAuthTokens(_serverDto);
         var auth          = auths[0];
         ActionHelper.Execute(delegate()
         {
             _adJoinInfoDto = SnapInContext.Instance.ServiceGateway.Adf.JoinActiveDirectory(_serverDto, adJoinInfoDto, auth.Token);
             MMCDlgHelper.ShowWarning("Join operation completed successfully. Please reboot the node/server for the changes to take effect");
             Close();
         }, auth);
     }
 }
 public LeaveActiveDirectoryView(ServerDto serverDto, ActiveDirectoryJoinInfoDto adJoinInfoDto)
 {
     InitializeComponent();
     _adJoinInfoDto = adJoinInfoDto;
     _serverDto     = serverDto;
 }