Beispiel #1
0
        public VerificationBaseVM()
        {
            GoToVerification = new RelayCommand(it => ShowVerification());
            BackCommand      = new RelayCommand(it => Navigator.ShowScreenWithPath(ScreenPaths.Login));

            ErrorHandler = msg => UiContext.StartNew(() => ShowErrorMessage(msg));
        }
Beispiel #2
0
        private void OpenJob(object it)
        {
            try
            {
                var job = it as Job;
                if (job == null)
                {
                    return;              // shoudnt happen anyways
                }
                if (!job.HasPayload)
                {
                    ErrorMessage = "Cannot open job without downloading it before";
                    return;
                }

                var workspaceModel  = crypCloudCore.GetWorkspaceOfJob(job.JobId);
                var workspaceEditor = workspaceModel.MyEditor;
                if (workspaceEditor == null || workspaceEditor.HasBeenClosed)
                {
                    UiContext.StartNew(() =>
                    {
                        try
                        {
                            Manager.OpenWorkspaceInNewTab(workspaceModel, job.JobId, job.JobName);
                        }
                        catch (Exception ex)
                        {
                            ErrorMessage = String.Format("Exception while opening new tab: {0}", ex.Message);
                        }
                    });
                }
                else
                {
                    ErrorMessage = "Workspace is already open.";
                }
            }
            catch (Exception ex)
            {
                ErrorMessage = String.Format("Exception while opening job: {0}", ex.Message);
            }
        }