Esempio n. 1
0
 private void ArgumentDisconnected(object sender, DisconnectedEventArgs e)
 {
     ClientService.GetInstance().Client = null;
     View.Invoke(() =>
     {
         loadingContextView.Hide();
         bool executed = Argument.ClientStatus == ClientStatus.Executed;
         ResultArgument resultArgument = new ResultArgument(e.Reason, executed ? Argument.Points.ToString() : "Нет значения", executed ? Argument.Mark.ToString() : "Нет значения");
         View.Hide();
         ApplicationController.Run <ResultPresenter, ResultArgument>(resultArgument);
         View.Close();
     });
 }
Esempio n. 2
0
        private void ViewDisconnected(IMainView sender)
        {
            ClientService.GetInstance().Client = null;
            ClientStatus temp = Argument.ClientStatus;

            Argument.Disconnect();
            if (temp == ClientStatus.Connected)
            {
                View.Invoke(() =>
                {
                    loadingContextView.Hide();
                    bool executed = Argument.ClientStatus == ClientStatus.Executed;
                    ResultArgument resultArgument = new ResultArgument("Клиент отключился.", executed ? Argument.Points.ToString() : "-", executed ? Argument.Mark.ToString() : "-");
                    View.Hide();
                    ApplicationController.Run <ResultPresenter, ResultArgument>(resultArgument);
                    View.Close();
                });
            }
        }