Exemple #1
0
        public ProtocolAction(Dictionary <ClientView, IView> views, Client client, ClientDataPackageProvider clientDataPackageProvider, GameOutput game)
        {
            _clientDataPackageProvider = clientDataPackageProvider;
            _clientDataProvider        = new ClientDataProvider();
            _client = client;
            _views  = views;
            _game   = game;
            #region ahhhhhhhhhhhhhhhh2
            _serverTableView       = views[ClientView.ServerTable] as IUpdateOutputView;
            _commandListOutputView = views[ClientView.CommandList] as IUpdateOutputView;
            _boardOutputView       = views[ClientView.Board] as IUpdateOutputView;
            _errorView             = views[ClientView.Error] as IErrorView;
            _gameInfoOutputView    = views[ClientView.GameInfo] as IUpdateOutputView;
            _turnInfoOutputView    = views[ClientView.TurnInfo] as IUpdateOutputView;
            _afterTurnOutputView   = views[ClientView.AfterTurnOutput] as IUpdateOutputView;
            _mainMenuOutputView    = views[ClientView.MenuOutput] as IUpdateOutputView;
            _lobbyInfoDisplayView  = views[ClientView.LobbyInfoDisplay] as IUpdateOutputView;
            _infoOutputView        = views[ClientView.InfoOutput] as IUpdateOutputView;
            _finishInfoView        = views[ClientView.FinishInfo] as IUpdateOutputView;
            _finishSkull1View      = views[ClientView.FinishSkull1] as IUpdateOutputView;
            _finishSkull3View      = views[ClientView.FinishSkull3] as IUpdateOutputView;
            _finishSkull2View      = views[ClientView.FinishSkull2] as IUpdateOutputView;
            _enterToRefreshView    = views[ClientView.EnterToRefresh] as IUpdateOutputView;
            #endregion

            _protocolActions = new Dictionary <ProtocolActionEnum, Action <DataPackage, ICommunication> >
            {
            };
            _outputWrapper = new OutputWrapper();
        }
Exemple #2
0
        /// <summary>
        /// Shows the error view.
        /// </summary>
        private void ShowError()
        {
            IErrorView errorView = this.errorViewResolver();

            errorView.ErrorMessage = Resources.Resources.ProjectServiceSaveProjectError;
            errorView.Show();
        }
        /// <summary>
        /// Handles the AssetsAvailableEvent event.
        /// </summary>
        /// <param name="e">The <see cref="Infrastructure.DataEventArgs{T}"/> instance containing the event data.</param>
        private void OnAssetsAvailable(RCE.Infrastructure.DataEventArgs <List <Asset> > e)
        {
            if (e.Error == null)
            {
                if (this.currentFolderAsset != null)
                {
                    this.currentFolderAsset.AddAssets(e.Data);
                }
                else
                {
                    this.currentAssets = e.Data;
                }

                this.FilterAssets();
            }
            else
            {
                IErrorView errorView = this.errorViewResolver();
                errorView.ErrorMessage = Resources.Resources.MediaLibraryLoadAssetsError;
                errorView.Show();
            }

            this.UpArrowCommand.RaiseCanExecuteChanged();
            this.View.HideProgressBar();
        }
        private void ShowError()
        {
            IErrorView errorView = this.errorViewResolver();

            errorView.ErrorMessage = "The project you are trying to save contains gaps and that is not allowed. Please remove the gaps and try again.";
            errorView.Show();
        }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StaffListPresenter"/> class.
 /// </summary>
 /// <param name="daoServices">The DAO services.</param>
 /// <param name="view">The view.</param>
 /// <param name="errorView">The error view.</param>
 public StaffListPresenter(
     IServiceLocator daoServices,
     IPickListView view,
     IErrorView errorView)
     : base(daoServices, view)
 {
     this._errorView = errorView;
 }
Exemple #6
0
        /// <summary>
        /// Validates the specified condition.
        /// </summary>
        /// <param name="condition">If set to <c>true</c> [condition].</param>
        /// <param name="view">The view.</param>
        /// <param name="error">The error.</param>
        /// <returns></returns>
        public static bool Validate2(bool condition, IErrorView view, string error)
        {
            if (!condition)
            {
                view.AddError(error);
            }

            return condition;
        }
 public AlertsPresenter(
     IAlertsView view,
     IErrorView errorView,
     IApplicationController applicationController,
     ILoanRepository loanRepository)
 {
     _view                  = view;
     _errorView             = errorView;
     _applicationController = applicationController;
     _loanRepository        = loanRepository;
 }
 public UpgradePresenter(
     IUpgradeView view,
     IErrorView errorView,
     IBackgroundTaskFactory backgroundTaskFactory,
     IDatabaseService databaseService)
 {
     _view                  = view;
     _errorView             = errorView;
     _backgroundTaskFactory = backgroundTaskFactory;
     _databaseService       = databaseService;
 }
Exemple #9
0
 public UpgradePresenter(
     IUpgradeView view, 
     IErrorView errorView, 
     IBackgroundTaskFactory backgroundTaskFactory,
     IDatabaseService databaseService)
 {
     _view = view;
     _errorView = errorView;
     _backgroundTaskFactory = backgroundTaskFactory;
     _databaseService = databaseService;
 }
Exemple #10
0
 public AlertsPresenter(
     IAlertsView view,
     IErrorView errorView,
     IApplicationController applicationController,
     ILoanRepository loanRepository)
 {
     _view = view;
     _errorView = errorView;
     _applicationController = applicationController;
     _loanRepository = loanRepository;
 }
Exemple #11
0
        public ErrorPresenter(IErrorView _view, Exception ex)
        {
            this._view = _view;

            if (SettingsManager.instance.currentSettings.WriteLog)
            {
                Utils.WriteLog("Error", GetErrorDetails(ex));
            }


            _view.SetErrorMessage(ex.Message);
            _view.SetErrorDetails(GetErrorDetails(ex));
        }
Exemple #12
0
        /// <summary>
        /// Checks the submit.
        /// </summary>
        /// <param name="dao">The DAO.</param>
        /// <param name="view">The view.</param>
        /// <returns></returns>
        public static bool CheckSubmit(GenericDao dao, IErrorView view)
        {
            if (!dao.CanSubmitChanges())
            {
                foreach (var error in dao.InvalidEntities.SelectMany(entity => entity.Errors).Distinct())
                {
                    view.AddError(error);
                }

                return false;
            }

            return true;
        }
Exemple #13
0
        public Presenter(
            IRouteView routeView,
            IErrorView errorView,
            IGuiStateSetter guiControls,
            ICommandRunner commandRunner
            )
        {
            _routeView     = routeView;
            _errorView     = errorView;
            _guiControls   = guiControls;
            _commandRunner = commandRunner;

            HookupEvents();
            InitializeGuiState();
        }
Exemple #14
0
 public LoginPresenter(
     ILoginView view,
     IErrorView errorView,
     IDatabaseService databaseService,
     IAuthService authService,
     ISettingsService settingsService,
     IBackgroundTaskFactory backgroundTaskFactory)
 {
     _view = view;
     _errorView = errorView;
     _databaseService = databaseService;
     _authService = authService;
     _settingsService = settingsService;
     _backgroundTaskFactory = backgroundTaskFactory;
 }
 public ChangePasswordPresenter(
     IPasswordView view,
     IErrorView errorView,
     IDatabaseService databaseService,
     IAuthService authService,
     ISettingsService settingsService,
     IBackgroundTaskFactory backgroundTaskFactory)
 {
     _view                  = view;
     _errorView             = errorView;
     _databaseService       = databaseService;
     _authService           = authService;
     _settingsService       = settingsService;
     _backgroundTaskFactory = backgroundTaskFactory;
 }
 public LoginVerificationPresenter(
     ILoginVerificationView view,
     IErrorView errorView,
     IDatabaseService databaseService,
     IAuthService authService,
     ISettingsService settingsService,
     IBackgroundTaskFactory backgroundTaskFactory)
 {
     _view                  = view;
     _errorView             = errorView;
     _databaseService       = databaseService;
     _authService           = authService;
     _settingsService       = settingsService;
     _backgroundTaskFactory = backgroundTaskFactory;
 }
Exemple #17
0
 /// <summary>
 /// Shows the pending notifications if any.
 /// </summary>
 private void HandlePendingNotifications()
 {
     if (Deployment.Current.Dispatcher.CheckAccess())
     {
         if (this.hasErrors)
         {
             this.View.HideProgressBar();
             IErrorView errorView = this.errorViewResolver();
             errorView.ErrorMessage = Resources.Resources.ProjectServiceLoadProjectsError;
             errorView.Show();
         }
     }
     else
     {
         Deployment.Current.Dispatcher.BeginInvoke(() => this.HandlePendingNotifications());
     }
 }
        public InputAction(ProtocolAction protocolAction, Dictionary <ClientView, IView> views, Client client, ClientDataPackageProvider clientDataPackageProvider)
        {
            _clientDataPackageProvider = clientDataPackageProvider;
            _client                = client;
            _actionHandler         = protocolAction;
            _views                 = views;
            _errorView             = views[ClientView.Error] as IErrorView;              // Potential null exception error.
            _commandListOutputView = views[ClientView.CommandList] as IUpdateOutputView; //Potenzieller Null Ausnahmen Fehler
            _inputView             = views[ClientView.Input] as IInputView;
            _serverTableView       = views[ClientView.ServerTable] as IUpdateOutputView;
            _infoOutputView        = views[ClientView.InfoOutput] as IUpdateOutputView;
            _mainMenuOutputView    = views[ClientView.MenuOutput] as IUpdateOutputView;

            _outputWrapper = new OutputWrapper();

            _inputActions = new Dictionary <string, Action <string, ICommunication> >
            {
            };

            _udpListener = new UdpClientUnit();
        }