CalDavSynchronizer.Ui.Options.ViewModels.OptionsCollectionViewModel.Close C# (CSharp) Method

Close() private method

private Close ( bool shouldSaveNewOptions ) : void
shouldSaveNewOptions bool
return void
    private void Close (bool shouldSaveNewOptions)
    {
      if (shouldSaveNewOptions)
      {
        IOptionsViewModel firstViewModelWithError;
        string errorMessage;
        if (!Validate (out errorMessage, out firstViewModelWithError))
        {
          _uiService.ShowErrorDialog (errorMessage, "Some Options contain invalid Values");
          if (firstViewModelWithError != null)
            firstViewModelWithError.IsSelected = true;
          return;
        }
      }

      CloseRequested?.Invoke (this, new CloseEventArgs (shouldSaveNewOptions));
    }