Example #1
0
        public void AnonymizeStudy()
        {
            _component = new AnonymizeStudyComponent(Context.SelectedStudy);
            if (ApplicationComponentExitCode.Accepted ==
                ApplicationComponent.LaunchAsDialog(Context.DesktopWindow, _component, SR.TitleAnonymizeStudy))
            {
                if (LocalStorageMonitor.IsMaxUsedSpaceExceeded)
                {
                    Context.DesktopWindow.ShowMessageBox(SR.MessageCannotAnonymizeMaxDiskUsageExceeded, MessageBoxActions.Ok);
                    return;
                }

                BackgroundTask task = null;
                try
                {
                    task = new BackgroundTask(Anonymize, false, Context.SelectedStudy);
                    ProgressDialog.Show(task, Context.DesktopWindow, true);
                }
                catch (Exception e)
                {
                    Platform.Log(LogLevel.Error, e);
                    Context.DesktopWindow.ShowMessageBox(SR.MessageAnonymizeStudyFailed, MessageBoxActions.Ok);
                }
                finally
                {
                    if (task != null)
                    {
                        task.Dispose();
                    }
                }
            }
        }
Example #2
0
 public ValidateAnonymizationRule(AnonymizeStudyComponent parent, string property, ValidationFailureReason validationReason)
 {
     _parent           = parent;
     _property         = property;
     _validationReason = validationReason;
 }