public void Exit(ResponseOptions saveFile = ResponseOptions.Yes)
        {
            Courier courier = new Courier(saveFile, "JE_RUN_SAVE_FILES_CHECK");

            AdventurerAssociation.RegisterMember(courier);
            MainFormInvoke(MainForm.tmiExit_Click);
        }
 public void PrintMessage(TestContext testContext)
 {
     while (!FormReady)
     {
         Application.DoEvents();
     }
     AdventurerAssociation.PrintMessageFromArchivist(testContext);
 }
        public void NewJsonFiles(string targetPath, ResponseOptions deleteFile = ResponseOptions.Yes)
        {
            Courier courier = new Courier(deleteFile, "JE_RUN_NEW_JSON_FILES_Q_1");
            Bard    bard    = new Bard("SelectedPath", targetPath);

            bard.InputInformation.Add("DialogResult", ResponseOptions.OK);
            AdventurerAssociation.RegisterMember(bard);
            AdventurerAssociation.RegisterMember(courier);
            MainFormInvoke(MainForm.tmiNewJsonFiles_Click);
        }
        public void LoadJsonFiles(string targetPath, ResponseOptions saveFile = ResponseOptions.Yes)
        {
            Courier courier = new Courier(saveFile, "JE_RUN_SAVE_FILES_CHECK");
            Bard    bard    = new Bard("SelectedPath", targetPath);

            bard.InputInformation.Add("DialogResult", ResponseOptions.OK);
            AdventurerAssociation.RegisterMember(bard);
            AdventurerAssociation.RegisterMember(courier);
            MainFormInvoke(MainForm.tmiLoadJsonFiles_Click);
        }
        private void EndInvokeAndThrowException(IAsyncResult ar)
        {
            while (!ar.IsCompleted)
            {
                Application.DoEvents();
            }

            MainForm.EndInvoke(ar);

            if (Exception != null)
            {
                ExceptionDispatchInfo.Capture(Exception).Throw();
            }

            AdventurerAssociation.RegisterMember(new Bard());
            AdventurerAssociation.RegisterMember(new Courier());

            FormReady = true;
        }
 public JsonEditorTestSystem()
 {
     if (!AdventurerAssociation.Registered)
     {
         OutputFileStream = new FileStream(OutputOverview, FileMode.Create);
         AdventurerAssociation.RegisterMembers(OutputFileStream);
         AdventurerAssociation.Form_Start += AdventurerAssociation_Form_Start;
     }
     else
     {
         AdventurerAssociation.Archivist.WriteRecord("----------------------------------------------------");
         AdventurerAssociation.Archivist.WriteRecord("----------------------------------------------------");
     }
     MainForm = new MainForm
     {
         StartPosition = FormStartPosition.Manual,
         Left          = 30000,
         Top           = 30000
     };
     MainForm.Shown += MainForm_Shown;
     TestThread      = new Task(() => Application.Run(MainForm));
     TestThread.Start();
 }