/// <summary> /// Sets the current output service. /// </summary> /// <param name="outputservice">The instance of the output service to use in this application.</param> public static void SetOutputService(Altaxo.Main.Services.IOutputService outputservice) { if (null == sm_theOutputService) { sm_theOutputService = outputservice; } else { throw new ApplicationException("The output service can not be re-set to another value, only initialized for the first time!"); } }
public Reporter(TestAllProjectsInFolderOptions testOptions, Altaxo.Main.Services.IOutputService previousOutputService) { _previousOutputService = previousOutputService; if (!string.IsNullOrEmpty(testOptions.ProtocolFileName)) { var stream = new System.IO.FileStream(testOptions.ProtocolFileName, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.Read); _wr = new System.IO.StreamWriter(stream, Encoding.UTF8); _wr.WriteLine(); _wr.WriteLine("******************************************************************************"); _wr.WriteLine("{0}: Test of Altaxo project files. Folder(s) to test: {1}, SaveAndReopeningProjects: {2}", DateTime.Now, testOptions.FolderPaths, testOptions.TestSavingAndReopening); _wr.WriteLine("------------------------------------------------------------------------------"); } }
/// <summary> /// Sets the current output service. /// </summary> /// <param name="outputservice">The instance of the output service to use in this application.</param> public static Altaxo.Main.Services.IOutputService SetOutputService(Altaxo.Main.Services.IOutputService outputservice) { var oldOutputService = sm_theOutputService; if (null == sm_theOutputService) { sm_theOutputService = outputservice; } else if (sm_theOutputService is Altaxo.Main.Services.OutputServiceTemporary) { var oldService = sm_theOutputService as Altaxo.Main.Services.OutputServiceTemporary; sm_theOutputService = outputservice; sm_theOutputService.Write(oldService.Text); } else { if (null == outputservice) throw new ArgumentNullException(nameof(outputservice)); sm_theOutputService = outputservice; } return oldOutputService; }