/// <summary> /// Load a session from file. /// </summary> protected void LoadSession() { FileInfo sessionFileInfo = new FileInfo (sessionFileName); if (!sessionFileInfo.Exists) { sessionFileInfo = new FileInfo( baseLocation + sessionFileName ); if(!sessionFileInfo.Exists) { isLoaded = false; return; } else { sessionFileName = baseLocation + sessionFileName; } } try { implementation = DvtkSession.SessionFactory.TheInstance.Load(sessionFileName); isLoaded = true; GetAllProperties(); if(resultsRootDirectory.IndexOf("#") > 0) { MessageBox.Show("Result directory contains '#' which may cause undesired results.\nThe session directory will be set as new result directory.", "Warning"); FileInfo fileinfo = new FileInfo(implementation.SessionFileName); implementation.ResultsRootDirectory = fileinfo.DirectoryName ; implementation.SaveToFile(); implementation = DvtkSession.SessionFactory.TheInstance.Load(sessionFileName); isLoaded = true; resultsRootDirectory = fileinfo.DirectoryName; } } catch (Exception e) { string msg = string.Empty; msg += string.Format("Failed to load session file: {0}.\n", sessionFileName); msg += e.Message; implementation = null; isLoaded = false; Exception excp; throw excp = new Exception(msg); } }
public CountManager(Session session) { if (session == null) throw new System.ArgumentNullException(); this.m_parentSession = session; }
internal ActivityReporter(Session session) { if (session == null) throw new System.ArgumentNullException(); this.m_parentSession = session; }
internal Serializer( Serializer parentSerializer, Session session, bool isTopSerializer, Wrappers.WrappedSerializerNodeType reason) { this.m_serializerNodeType = reason; this.m_parentSerializer = parentSerializer; this.m_parentSession = session; this.m_bIsTopSerializer = isTopSerializer; if (this.m_bIsTopSerializer) { this.topDirectoryRecordErrorCountTable = new System.Collections.Hashtable(); this.topDirectoryRecordWarningCountTable = new System.Collections.Hashtable(); } else { this.topDirectoryRecordErrorCountTable = null; this.topDirectoryRecordWarningCountTable = null; } }
/// <summary> /// Load a session from file. /// </summary> protected void LoadSession() { FileInfo sessionFileInfo = new FileInfo (sessionFileName); if (!sessionFileInfo.Exists) { sessionFileInfo = new FileInfo( baseLocation + sessionFileName ); if(!sessionFileInfo.Exists) { isLoaded = false; return; } else { sessionFileName = baseLocation + sessionFileName; } } try { implementation = DvtkSession.SessionFactory.TheInstance.Load(sessionFileName); isLoaded = true; } catch (Exception e) { string msg = string.Format( "Failed to load session file: {0}\n{1}", sessionFileName, e.Message ); implementation = null; isLoaded = false; } GetAllProperties(); }
/// <summary> /// Copy all settings from the supplied session to this session. /// </summary> /// <param name="session">The session to copy the settings from.</param> public virtual void CopySettingsFrom(Session session) { // IGeneralSessionSettings. AutoCreateDirectory = session.AutoCreateDirectory; ContinueOnError = session.ContinueOnError; DataDirectory = session.DataDirectory; Date = session.Date; LogLevelFlags = session.LogLevelFlags; Manufacturer = session.Manufacturer; ModelName = session.ModelName; ResultsRootDirectory = session.ResultsRootDirectory; SessionFileName = session.SessionFileName; SessionId = session.SessionId; SessionTitle = session.SessionTitle; SoftwareVersions = session.SoftwareVersions; StorageMode = session.StorageMode; TestedBy = session.TestedBy; // IValidationSettings. DetailedValidationResults = session.DetailedValidationResults; DumpAttributesOfRefFiles = session.DumpAttributesOfRefFiles; IncludeType3NotPresentInResults = session.IncludeType3NotPresentInResults; StrictValidation = session.StrictValidation; SummaryValidationResults = session.SummaryValidationResults; UnVrDefinitionLookUp = session.UnVrDefinitionLookUp; ValidateReferencedFile = session.ValidateReferencedFile; // DefinitionManagement. DefinitionManagement.ApplicationEntityName = session.DefinitionManagement.ApplicationEntityName; DefinitionManagement.ApplicationEntityVersion = session.DefinitionManagement.ApplicationEntityVersion; DefinitionManagement.DefinitionFileRootDirectory = session.DefinitionManagement.DefinitionFileRootDirectory; DefinitionManagement.DefinitionFileDirectoryList.Clear(); foreach(String definitionFileDirectory in session.DefinitionManagement.DefinitionFileDirectoryList) { DefinitionManagement.DefinitionFileDirectoryList.Add(definitionFileDirectory); } foreach(String definitionFileName in session.DefinitionManagement.LoadedDefinitionFileNames) { DefinitionManagement.LoadDefinitionFile(definitionFileName); } }