/// <summary> /// Remove all expanded information for the supplied session. /// </summary> /// <param name="theSession">The session.</param> public void RemoveExpandInformationForSession(DvtkApplicationLayer.Session theSession) { ArrayList theTagsToRemove = new ArrayList(); foreach(Object theTreeNodeTag in _TagsOfExpandedNodes) { DvtkApplicationLayer.Session tempSession = null; if (theTreeNodeTag is PartOfSession) { DvtkApplicationLayer.PartOfSession partOfSession = theTreeNodeTag as PartOfSession; tempSession = partOfSession.ParentSession; } else { tempSession = (DvtkApplicationLayer.Session)theTreeNodeTag; } if (tempSession == theSession) { theTagsToRemove.Add(theTreeNodeTag); } } foreach( Object theTreeNodeTagToRemove in theTagsToRemove) { _TagsOfExpandedNodes.Remove(theTreeNodeTagToRemove); } }
public PrintEmulatorStatusForm(DvtkApplicationLayer.EmulatorSession emulator_session) { // // Required for Windows Form Designer support // InitializeComponent(); this.session = emulator_session; this.TextBoxManufacturer.Text = this.session.EmulatorSessionImplementation.Printer.Manufacturer; this.TextBoxModelName.Text = this.session.EmulatorSessionImplementation.Printer.ManufacturerModelName; this.TextBoxPrinterName.Text = this.session.EmulatorSessionImplementation.Printer.PrinterName; this.TextBoxSerialNumber.Text = this.session.EmulatorSessionImplementation.Printer.DeviceSerialNumber; this.TextBoxSoftwareVersions.Text = this.session.EmulatorSessionImplementation.Printer.SoftwareVersions; this.DateTimeCalibrationDate.Value = this.session.EmulatorSessionImplementation.Printer.DateOfLastCalibration.Date; this.DateTimeCalibrationTime.Value = this.session.EmulatorSessionImplementation.Printer.TimeOfLastCalibration.ToLocalTime (); // add the 3 possible Printer Status values this.ComboBoxPrinterStatus.Items.Add("NORMAL"); this.ComboBoxPrinterStatus.Items.Add("WARNING"); this.ComboBoxPrinterStatus.Items.Add("FAILURE"); string status = this.session.EmulatorSessionImplementation.Printer.Status.ToString(); foreach (object o in this.ComboBoxPrinterStatus.Items) { if (o.ToString() == status) { this.ComboBoxPrinterStatus.SelectedItem = o; break; } } string statusInfo = this.session.EmulatorSessionImplementation.Printer.StatusInfo.ToString(); foreach (string info_dt in this.session.EmulatorSessionImplementation.Printer.StatusInfoDefinedTerms) { this.ComboBoxPrinterStatusInfo.Items.Add (info_dt); } foreach (object o in this.ComboBoxPrinterStatusInfo.Items) { if (o.ToString() == statusInfo) { this.ComboBoxPrinterStatusInfo.SelectedItem = o; break; } } }
public PassWordForm(DvtkApplicationLayer.Session session, bool pwdCalledFirst) { // // Required for Windows Form Designer support // InitializeComponent(); this.PasswordTextBox.Text = ""; this._session = session; if (pwdCalledFirst == true) { this.InvalidPasswordLabel.Text = "Password"; } else { this.InvalidPasswordLabel.Text = "Invalid Password "; } // // TODO: Add any constructor code after InitializeComponent call // }
/// <summary> /// Method to backUp the Arraylist of files in a session. /// </summary> /// <param name="theSession">represents the Session.</param> /// <param name="theFilesToBackup"></param> public static void BackupFiles(DvtkApplicationLayer.Session theSession, ArrayList theFilesToBackup) { foreach (string theFileToBackup in theFilesToBackup) { BackupFile(theSession, theFileToBackup); } }
/// <summary> /// /// </summary> /// <param name="theSession"></param> /// <returns></returns> public static ArrayList GetAllNamesForSession(DvtkApplicationLayer.Session theSession) { ArrayList theResultsFiles = new ArrayList(); DirectoryInfo theDirectoryInfo; FileInfo[] theFilesInfo; theDirectoryInfo = new DirectoryInfo (theSession.ResultsRootDirectory); if (theDirectoryInfo.Exists) { theFilesInfo = theDirectoryInfo.GetFiles ("*.xml"); foreach (FileInfo theFileInfo in theFilesInfo) { string theResultsFileName = theFileInfo.Name; if (IsValid(theResultsFileName)) { theResultsFiles.Add(theResultsFileName); } } } return theResultsFiles; }
public void SetSessionChanged(DvtkApplicationLayer.Session theSession) { if (theSession == _SessionUsedForContentsOfTabSpecifySopClasses) { _SessionUsedForContentsOfTabSpecifySopClasses = null; } }
private DvtkSession.PrinterStatus Convert(DvtkApplicationLayer.EmulatorSession.PrinterStatus value) { switch (value) { case PrinterStatus.NORMAL: return DvtkSession.PrinterStatus.NORMAL; case PrinterStatus.WARNING: return DvtkSession.PrinterStatus.WARNING; case PrinterStatus.FAILURE: return DvtkSession.PrinterStatus.FAILURE; default: throw new System.NotSupportedException(); } }
private static void BackupFile(DvtkApplicationLayer.Session theSession, string theFileToBackup) { string theSourceFullFileName = System.IO.Path.Combine(theSession.ResultsRootDirectory, theFileToBackup); string theDestinyFullFileName = theSourceFullFileName + "_backup"; int theCounter = 1; try { while (File.Exists(theDestinyFullFileName + theCounter.ToString())) { theCounter++; } File.Copy(theSourceFullFileName, theDestinyFullFileName + theCounter.ToString()); } catch { // Don't do anything in the release version. Debug.Assert(false); } }
public DialogResult ShowDialog(IWin32Window theIWin32Window, DvtkApplicationLayer.EmulatorSession theEmulatorSession) { _EmulatorSession = theEmulatorSession; return(ShowDialog(theIWin32Window)); }
/// <summary> /// From a list of results file names, return those results file names with the same session ID /// as the session ID of the supplied session. /// </summary> /// <param name="theSession">The session.</param> /// <param name="theResultsFileNames">Valid results file names.</param> /// <returns>List of results file names.</returns> public static ArrayList GetNamesForCurrentSessionId(DvtkApplicationLayer.Session theSession, ArrayList theResultsFileNames) { ArrayList theNamesForCurrentSession = new ArrayList(); string theSessionIdAsString = theSession.SessionId.ToString("000"); foreach(string theResultsFileName in theResultsFileNames) { string theResultsFileSessionIdAsString = ""; if (theResultsFileName.ToLower().StartsWith(_SUMMARY_PREFIX)) { theResultsFileSessionIdAsString = theResultsFileName.Substring(_SUMMARY_PREFIX.Length, 3); } else if (theResultsFileName.ToLower().StartsWith(_DETAIL_PREFIX)) { theResultsFileSessionIdAsString = theResultsFileName.Substring(_DETAIL_PREFIX.Length, 3); } else { // Sanity check. Debug.Assert(false); } if (theResultsFileSessionIdAsString == theSessionIdAsString) { theNamesForCurrentSession.Add(theResultsFileName); } } return(theNamesForCurrentSession); }
/// <summary> /// /// </summary> /// <param name="theSession"></param> /// <param name="theScriptFileName"></param> /// <returns></returns> public static string GetSummaryNameForScriptFile(DvtkApplicationLayer.Session theSession, string theScriptFileName) { return("Summary_" + GetExpandedNameForScriptFile(theSession, theScriptFileName)); }
/// <summary> /// /// </summary> /// <param name="theProject"></param> /// <param name="theMainForm"></param> public ProjectForm2(DvtkApplicationLayer.Project theProject, MainForm theMainForm) { // // Required for Windows Form Designer support // InitializeComponent(); this.userControlSessionTree.projectApp = theProject; userControlSessionTree.ProjectForm = this; _ActivityReportEventHandler = new Dvtk.Events.ActivityReportEventHandler(TCM_OnActivityReportEvent); projectApp = theProject; _MainForm = theMainForm; ListBoxSecuritySettings.SelectedIndex = 0; _SopClassesManager = new SopClassesManager(this, DataGridSpecifySopClasses, ComboBoxSpecifySopClassesAeTitle, ListBoxSpecifySopClassesDefinitionFileDirectories, RichTextBoxSpecifySopClassesInfo, userControlSessionTree, ButtonSpecifySopClassesRemoveDirectory); _TCM_ValidationResultsBrowser = new ValidationResultsManager(webBrowserValResult); //_TCM_ValidationResultsManagerBrowser = new ValidationResultsManager(webBrowserResultMgr); // Because the webbrowser navigation is "cancelled" when browsing to an .xml file // first another html file has to be shown to make this work under Windows 2000. _TCM_ValidationResultsBrowser.ShowHtml("about:blank"); _TCM_AppendTextToActivityLogging_ThreadSafe_Delegate = new TCM_AppendTextToActivityLogging_ThreadSafe_Delegate(this.TCM_AppendTextToActivityLogging_ThreadSafe); resultProjectXml = projectApp.ProjectFileName + ".xml"; }
/// <summary> /// /// </summary> /// <param name="theSession"></param> /// <param name="theEmulatorType"></param> /// <returns></returns> public static string GetExpandedNameForEmulator(DvtkApplicationLayer.Session theSession, Emulator.EmulatorTypes theEmulatorType) { return(GetExpandedName(theSession, GetBaseNameForEmulator(theEmulatorType))); }
public void UpdateScriptFileNode(TreeNode scriptFileTreeNode,DvtkApplicationLayer.Script scriptFile ) { // Set the text on this script file tree node. if (scriptFile.ParentSession.IsExecute) { scriptFileTreeNode.Text = scriptFile.ScriptFileName + " (executing)"; } else { scriptFileTreeNode.Text = scriptFile.ScriptFileName; } // Set the tag for this script file tree node. scriptFileTreeNode.Tag = scriptFile; // Remove the old tree nodes that may be present under this script file tree node. scriptFileTreeNode.Nodes.Clear(); // For all results that belong to this script file, create a sub node. // The theResultsFiles object contains all results files that have not yet been added to // already processed script file nodes. foreach (Result results in scriptFile.Result ) { foreach (string filename in results.ResultFiles) { TreeNode resultsFileTreeNode = new TreeNode(); scriptFileTreeNode.Nodes.Add(resultsFileTreeNode); UpdateResultsFileNode(resultsFileTreeNode,results ,filename ); } } }
public void UpdateMediaSessionNode(TreeNode mediaSessionTreeNode, DvtkApplicationLayer.MediaSession mediaSession) { bool isSessionExecuting = mediaSession.IsExecute; // Set the tag for this session tree node. mediaSessionTreeNode.Tag = mediaSession; // Remove the old tree nodes that may be present under this session tree node. mediaSessionTreeNode.Nodes.Clear(); mediaSession.CreateMediaFiles(); if (!isSessionExecuting) { if (mediaSession.MediaFiles == null ){ } else { foreach(MediaFile mediaFile in mediaSession.MediaFiles) { TreeNode mediaTreeNode = new TreeNode(); mediaSessionTreeNode.Nodes.Add(mediaTreeNode); UpdateMediaFileNode(mediaTreeNode , mediaFile); } } } }
public void UpdateMediaFileNode(TreeNode mediaFileTreeNode,DvtkApplicationLayer.MediaFile mediaFile ) { mediaFileTreeNode.Text = mediaFile.MediaFileName ; // Set the tag for this media file tree node. mediaFileTreeNode.Tag = mediaFile; // Remove the old tree nodes that may be present under this script file tree node. mediaFileTreeNode.Nodes.Clear(); // For all results that belong to this media file, create a sub node. // The theResultsFiles object contains all results files that have not yet been added to // already processed script file nodes. foreach (Result results in mediaFile.Result ) { foreach (string filename in results.ResultFiles) { TreeNode resultsFileTreeNode = new TreeNode(); mediaFileTreeNode.Nodes.Add(resultsFileTreeNode); UpdateResultsFileNode(resultsFileTreeNode,results,filename); } } }
// public TreeNode GetSessionNode(DvtkApplicationLayer.Session session) { // TreeNode theSessionNodeToFind = null; // // foreach (TreeNode theNode in userControlTreeView.Nodes) { // if (theNode.Tag is DvtkApplicationLayer.Session) { // Object theSessionTag = (DvtkApplicationLayer.Session)theNode.Tag; // // if (theSessionTag == session) { // theSessionNodeToFind = theNode; // break; // } // } // } // // return(theSessionNodeToFind); // } public TreeNode GetSessionNode(DvtkApplicationLayer.Session session) { TreeNode theSessionNodeToFind = null; foreach (TreeNode theNode in userControlTreeView.Nodes) { if (theNode.Tag is DvtkApplicationLayer.Project) { foreach (TreeNode node in theNode.Nodes ) { if (node.Tag is DvtkApplicationLayer.Session) { Object theSessionTag = (DvtkApplicationLayer.Session)node.Tag; if (theSessionTag == session) { theSessionNodeToFind = node; break; } } } } } return(theSessionNodeToFind); }
public CredentialsCertificatesForm(DvtkApplicationLayer.Session session, bool show_credentials) { // // Required for Windows Form Designer support // InitializeComponent(); if (session.Implementation is Dvtk.Sessions.ISecure) { this._show_credentials = show_credentials; this._session = session; this.ButtonRemoveCertificate.Enabled = false; if (show_credentials) { this.Text = "DVT Private Keys (credentials)"; this.ButtonChangePassword.Visible = true ; _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CredentialsFileName; this._cred_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCredentialHandler (); } else { this.Text = "SUT Public Keys (certificates)"; this.ButtonChangePassword.Visible = false ; _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CertificateFileName; this._cert_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCertificateHandler (); } FileInfo cert_file = new FileInfo (_FileContainingKeys); if (cert_file.Exists) { try { if (show_credentials) { FileInfo file; file = new FileInfo (this._cred_handling.FileName); _FileContainingKeys = this._cred_handling.FileName; if (file.Exists) { _ExceptionText = ""; _KeysInformation = ConvertToKeyInformationArrayList(_cred_handling.Credentials); DataGridCertificates.DataSource = _KeysInformation; Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText); } if (this._cred_handling.Credentials.Count > 0) this.ButtonRemoveCertificate.Enabled = true; } else { FileInfo file; file = new FileInfo (this._cert_handling.FileName); _FileContainingKeys = this._cert_handling.FileName; if (file.Exists) { _ExceptionText = ""; _KeysInformation = ConvertToKeyInformationArrayList(_cert_handling.Certificates); DataGridCertificates.DataSource = _KeysInformation; Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText); } if (this._cert_handling.Certificates.Count > 0) this.ButtonRemoveCertificate.Enabled = true; } } catch { this.DataGridCertificates.DataSource = null; } } } }
/// <summary> /// /// </summary> /// <param name="theSession"></param> /// <param name="theScriptFileName"></param> /// <returns></returns> public static string GetExpandedNameForScriptFile(DvtkApplicationLayer.Session theSession, string theScriptFileName) { return(GetExpandedName(theSession, GetBaseNameForScriptFile(theScriptFileName))); }
public SessionChange(DvtkApplicationLayer.Session theSession, SessionChangeSubTypEnum theSessionChangeSubTyp) { session = theSession; _SessionChangeSubTyp = theSessionChangeSubTyp; }
/// <summary> /// /// </summary> /// <param name="theSession"></param> /// <param name="theEmulatorType"></param> /// <returns></returns> public static string GetSummaryNameForEmulator(DvtkApplicationLayer.Session theSession, Emulator.EmulatorTypes theEmulatorType) { return("Summary_" + GetExpandedNameForEmulator(theSession, theEmulatorType)); }
public SessionRemovedEvent(DvtkApplicationLayer.Session theSession) { _Session = theSession; }
/// <summary> /// Remove .xml files, and if exisiting, the corresponding .html files. /// </summary> /// <param name="theSession">The session.</param> /// <param name="theResultsFileNames">The results file names.</param> public static void Remove(DvtkApplicationLayer.Session theSession, ArrayList theResultsFileNames) { foreach(string theResultsFileName in theResultsFileNames) { string theXmlResultsFullFileName = System.IO.Path.Combine(theSession.ResultsRootDirectory, theResultsFileName); string theHtmlResultsFullFileName = theXmlResultsFullFileName.ToLower().Replace(".xml", ".html"); if (!File.Exists(theXmlResultsFullFileName)) { // Sanity check. Debug.Assert(false); } else { try { File.Delete(theXmlResultsFullFileName); } catch(Exception ex) { MessageBox.Show(ex.Message); // In release mode, just continue. Debug.Assert(false); } } if (File.Exists(theHtmlResultsFullFileName)) { try { File.Delete(theHtmlResultsFullFileName); } catch(Exception ex) { // In release mode, just continue. MessageBox.Show(ex.Message); Debug.Assert(false); } } } }
public SessionReplaced(DvtkApplicationLayer.Session theOldSession, DvtkApplicationLayer.Session theNewSession) { _OldSession = theOldSession; _NewSession = theNewSession; }
/// <summary> /// /// </summary> /// <param name="theSession"></param> /// <param name="theString"></param> /// <returns></returns> private static string GetExpandedName(DvtkApplicationLayer.Session theSession, string theString) { return(theSession.SessionId.ToString("000") + '_' + theString + "_res.xml"); }
public void ConstructAndSaveProject(DvtkApplicationLayer.Project theProject) { theProject.display_message = new DvtkApplicationLayer.Project.CallBackMessageDisplay (this.CallBackMessageDisplay); theProject.New(this.ProjectFileName.Text); foreach (object session in this.ListBoxSessions.Items) { theProject.AddSession(session.ToString()); } theProject.SaveProject(); }