public void DeepCopyFrom(DicomThreadOptions dicomThreadOptions) { // Copy all settings from the Dvtk ScriptSession object. // Get a full file name to temporarily store the session content. String tempSessionFullFileName = Path.GetTempFileName(); // Save the session content to a file. String currentSessionFullFileName = dicomThreadOptions.DvtkScriptSession.SessionFileName; dicomThreadOptions.DvtkScriptSession.SessionFileName = tempSessionFullFileName; dicomThreadOptions.DvtkScriptSession.SaveToFile(); dicomThreadOptions.DvtkScriptSession.SessionFileName = currentSessionFullFileName; // Load the session content in Dvtk Session field of this object. this.dicomThread.DvtkScriptSession = Dvtk.Sessions.ScriptSession.LoadFromFile(tempSessionFullFileName); // Remove the temporary file. File.Delete(tempSessionFullFileName); // Copy all other settings not contained in the Dvtk ScriptSession object.. AttachChildsToUserInterfaces = dicomThreadOptions.AttachChildsToUserInterfaces; AutoValidate = dicomThreadOptions.autoValidate; ShowResults = dicomThreadOptions.showResults; }
public void DeepCopyFrom(DicomThreadOptions dicomThreadOptions) { // Copy all settings from the Dvtk ScriptSession object. // Get a full file name to temporarily store the session content. String tempSessionFullFileName = Path.GetTempFileName(); // Save the session content to a file. String currentSessionFullFileName = dicomThreadOptions.DvtkScriptSession.SessionFileName; dicomThreadOptions.DvtkScriptSession.SessionFileName = tempSessionFullFileName; dicomThreadOptions.DvtkScriptSession.SaveToFile(); dicomThreadOptions.DvtkScriptSession.SessionFileName = currentSessionFullFileName; // Load the session content in Dvtk Session field of this object. this.dicomThread.DvtkScriptSession = Dvtk.Sessions.ScriptSession.LoadFromFile(tempSessionFullFileName); // Remove the temporary file. File.Delete(tempSessionFullFileName); // Copy all other settings not contained in the Dvtk ScriptSession object.. AttachChildsToUserInterfaces = dicomThreadOptions.AttachChildsToUserInterfaces; AutoValidate = dicomThreadOptions.autoValidate; ShowResults = dicomThreadOptions.showResults; }