Example #1
0
        public void SetSelectedAeTitleVersion()
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            AeTitleVersion theCurrentAeTitleVersionInComboBox = null;

            foreach (AeTitleVersion theAeTitleVersion in _ComboBoxAeTitle.Items)
            {
                if ((theAeTitleVersion._AeTitle == theSession.Implementation.DefinitionManagement.ApplicationEntityName) &&
                    (theAeTitleVersion._Version == theSession.Implementation.DefinitionManagement.ApplicationEntityVersion))
                {
                    theCurrentAeTitleVersionInComboBox = theAeTitleVersion;
                    break;
                }
            }

            if (theCurrentAeTitleVersionInComboBox != null)
            {
                _ComboBoxAeTitle.SelectedItem = theCurrentAeTitleVersionInComboBox;
            }
            else
            {
                _ComboBoxAeTitle.SelectedItem = _DefaultAeTitleVersion;
            }
        }
Example #2
0
        private bool IsDefinitionFileLoaded(string theFullDefinitionFileName)
        {
            bool theReturnValue = false;

            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            foreach (string theLoadedDefinitionFileName in theSession.Implementation.DefinitionManagement.LoadedDefinitionFileNames)
            {
                string thetheLoadedDefinitionFullFileName = theLoadedDefinitionFileName;

                // If theLoadedDefinitionFileName does not contain a '\', this is a file name only.
                // Append the Root directory to get the full path name.
                if (theLoadedDefinitionFileName.LastIndexOf("\\") == -1)
                {
                    thetheLoadedDefinitionFullFileName = System.IO.Path.Combine(theSession.Implementation.DefinitionManagement.DefinitionFileRootDirectory, theLoadedDefinitionFileName);
                }

                if (thetheLoadedDefinitionFullFileName.ToLower() == theFullDefinitionFileName.ToLower())
                {
                    theReturnValue = true;
                    break;
                }
            }

            return(theReturnValue);
        }
Example #3
0
        private void AddSopClassesToDataGridFromDirectories()
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();
            Dvtk.Sessions.DefinitionFileDirectoryList theDefinitionFileDirectoryList = theSession.Implementation.DefinitionManagement.DefinitionFileDirectoryList;

            foreach (string theDefinitionFileDirectory in theDefinitionFileDirectoryList)
            {
                DirectoryInfo theDirectoryInfo = new DirectoryInfo(theDefinitionFileDirectory);

                if (theDirectoryInfo.Exists)
                {
                    FileInfo[] theFilesInfo;

                    theFilesInfo = theDirectoryInfo.GetFiles("*.def");

                    foreach (FileInfo theDefinitionFileInfo in theFilesInfo)
                    {
                        try
                        {
                            AddSopClassToDataGridFromDefinitionFile(theDefinitionFileInfo.FullName);
                        }
                        catch (Exception exception)
                        {
                            string theErrorText;

                            theErrorText = string.Format("Definition file {0} could not be interpreted while reading directory:\n{1}\n\n", theDefinitionFileInfo.FullName, exception.Message);

                            _RichTextBoxInfo.AppendText(theErrorText);
                        }
                    }
                }
            }
        }
Example #4
0
 public void SetSessionChanged(DvtkApplicationLayer.Session theSession)
 {
     if (theSession == _SessionUsedForContentsOfTabSpecifySopClasses)
     {
         _SessionUsedForContentsOfTabSpecifySopClasses = null;
     }
 }
Example #5
0
        public void UnSelectAllDefinitionFiles()
        {
            int tempCount = 0;

            DvtkApplicationLayer.Session theSession     = GetSessionTreeViewManager().GetSession();
            DataGridBoolColumn           dataBoolColumn = new DataGridBoolColumn();

            foreach (DefinitionFile theDefinitionFile in  _DefinitionFilesInfoForDataGrid)
            {
                string theFullFileName = System.IO.Path.Combine(theDefinitionFile.DefinitionRoot, theDefinitionFile.Filename);
                theSession.Implementation.DefinitionManagement.UnLoadDefinitionFile(theFullFileName);
                //_DataGridSopClasses[tempCount,0] = dataBoolColumn.FalseValue;
                // Get the column style for the "loaded" column.
                DataGridColumnStyle theColStyle = _DataGridSopClasses.TableStyles[0].GridColumnStyles[0];

                // Change the "loaded" stated in _DefinitionFilesInfoForDataGrid and the data grid itself.
                _DataGridSopClasses.BeginEdit(theColStyle, tempCount);
                theDefinitionFile.Loaded = false;
                _DataGridSopClasses.EndEdit(theColStyle, tempCount, false);

                tempCount++;
            }

            _DataGridSopClasses.SetDataBinding(_DefinitionFilesInfoForDataGrid, "");
            // Notify the rest of the world.
            SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_LOADED_STATE);

            Notify(theSessionChange);
        }
Example #6
0
        /// <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);
            }
        }
Example #7
0
        /// <summary>
        /// The reason we handle the mouseup event ourselves, is because with the normal
        /// grid, you first have to select a cell, and only then you can enable/disable a
        /// checkbox. We want to enable/disable the checkbox with 1 click.
        /// </summary>
        /// <param name="e"></param>
        public void DataGrid_MouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            System.Windows.Forms.DataGrid.HitTestInfo theHitTestInfo;
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            // Find out what part of the data grid is below the mouse pointer.
            theHitTestInfo = _DataGridSopClasses.HitTest(e.X, e.Y);

            switch (theHitTestInfo.Type)
            {
            case System.Windows.Forms.DataGrid.HitTestType.Cell:
                // If this is the "loaded" column...
                if (theHitTestInfo.Column == 0)
                {
                    // Remember the cell we've changed. We don't want to change this cell when we move the mouse.
                    // (see DataGrid_MouseMove).
                    _MouseEventInfoForDataGrid_LoadedStateChangedForRow = theHitTestInfo.Row;

                    // Get the column style for the "loaded" column.
                    DataGridColumnStyle theDataGridColumnStyle;
                    theDataGridColumnStyle = _DataGridSopClasses.TableStyles[0].GridColumnStyles[0];

                    // Change the "loaded" stated in _DefinitionFilesInfoForDataGrid and the data grid itself.
                    _DataGridSopClasses.BeginEdit(theDataGridColumnStyle, theHitTestInfo.Row);
                    DefinitionFile theDefinitionFile = (DefinitionFile)_DefinitionFilesInfoForDataGrid[theHitTestInfo.Row];
                    theDefinitionFile.Loaded = !theDefinitionFile.Loaded;
                    _DataGridSopClasses.EndEdit(theDataGridColumnStyle, theHitTestInfo.Row, false);


                    // Change the "loaded" state in the session object.
                    string theFullFileName = System.IO.Path.Combine(theDefinitionFile.DefinitionRoot, theDefinitionFile.Filename);

                    if (theDefinitionFile.Loaded)
                    {
                        // The definition file was not loaded yet. Load it now.
                        theSession.Implementation.DefinitionManagement.LoadDefinitionFile(theFullFileName);
                    }
                    else
                    {
                        // The definition file was loaded. Unload it now.
                        theSession.Implementation.DefinitionManagement.UnLoadDefinitionFile(theFullFileName);
                    }

                    // Remember the new "loaded" state for the case where the mouse is moved over other
                    // "loaded" checkboxes while keeping the left mouse button pressed.
                    _MouseEventInfoForDataGrid_LoadedStatedAfterMouseDown = theDefinitionFile.Loaded;

                    // Notify the rest of the world.
                    SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_LOADED_STATE);
                    Notify(theSessionChange);
                }

                if (theHitTestInfo.Column == 1)
                {
                    DefinitionFile theDefinitionFile = (DefinitionFile)_DefinitionFilesInfoForDataGrid[theHitTestInfo.Row];
                    DefinitionName = theDefinitionFile.Filename;
                }
                break;
            }
        }
Example #8
0
        /// <summary>
        /// Add a definition file direcotory.
        /// </summary>
        public void AddDefinitionFileDirectory()
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();
            Dvtk.Sessions.DefinitionFileDirectoryList theDefinitionFileDirectoryList = theSession.Implementation.DefinitionManagement.DefinitionFileDirectoryList;

            FolderBrowserDialog theFolderBrowserDialog = new FolderBrowserDialog();

            theFolderBrowserDialog.Description = "Select the directory where definition files are located.";

            if (theFolderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                bool   isExistingDirectory = false;
                string theNewDirectory     = GetDirectoryWithTrailingSlashesRemoved(theFolderBrowserDialog.SelectedPath);

                // Find out if this new directory already exists.
                foreach (string theExistingDirectory in theDefinitionFileDirectoryList)
                {
                    if (theNewDirectory == GetDirectoryWithTrailingSlashesRemoved(theExistingDirectory))
                    {
                        isExistingDirectory = true;
                        break;
                    }
                }

                theNewDirectory = theNewDirectory + "\\";

                // Only add this new directory if it does not already exist.
                if (!isExistingDirectory)
                {
                    DirectoryInfo theDirectoryInfo = new DirectoryInfo(theNewDirectory);

                    // If the new directory is not valid, show an error message.
                    if (!theDirectoryInfo.Exists)
                    {
                        MessageBox.Show("The directory \"" + theNewDirectory + "\" is not a valid directory.",
                                        "Directory not added",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                    }
                    else
                    {
                        theDefinitionFileDirectoryList.Add(theNewDirectory);

                        // Notify the rest of the world.
                        // This will implicitly also update this specify SOP classes tab.

                        SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_OTHER);
                        Notify(theSessionChange);
                    }
                }
                else
                {
                    MessageBox.Show("The directory \"" + theNewDirectory + "\" is already present in\nthe list of definition file directories.",
                                    "Directory not added",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
            }
        }
Example #9
0
        public void SelectedAeTitleVersionChanged()
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            AeTitleVersion theAeTitleVersion = (AeTitleVersion)_ComboBoxAeTitle.SelectedItem;

            if ((theAeTitleVersion._AeTitle != theSession.Implementation.DefinitionManagement.ApplicationEntityName) ||
                (theAeTitleVersion._Version != theSession.Implementation.DefinitionManagement.ApplicationEntityVersion))
            {
                theSession.Implementation.DefinitionManagement.ApplicationEntityName    = theAeTitleVersion._AeTitle;
                theSession.Implementation.DefinitionManagement.ApplicationEntityVersion = theAeTitleVersion._Version;
                // TO DO
                SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_AE_TITLE_VERSION);
                Notify(theSessionChange);
            }
        }
Example #10
0
        private void AddSopClassesToDataGridFromLoadedDefinitions()
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            foreach (string theLoadedDefinitionFileName in theSession.Implementation.DefinitionManagement.LoadedDefinitionFileNames)
            {
                string theLoadedDefinitionFullFileName = theLoadedDefinitionFileName;

                // If theLoadedDefinitionFileName does not contain a '\', this is a file name only.
                // Append the Root directory to get the full path name.
                if (theLoadedDefinitionFileName.LastIndexOf("\\") == -1)
                {
                    theLoadedDefinitionFullFileName = System.IO.Path.Combine(theSession.Implementation.DefinitionManagement.DefinitionFileRootDirectory, theLoadedDefinitionFileName);
                }

                // Check if this definition file is already present in the data grid.
                // Do this by comparing the full file name of the definition file with the full file names
                // present in the data grid.
                bool IsDefinitionAlreadyPresent = false;

                foreach (DefinitionFile theDefinitionFile in  _DefinitionFilesInfoForDataGrid)
                {
                    string defFileForDataGrid = System.IO.Path.Combine(theDefinitionFile.DefinitionRoot, theDefinitionFile.Filename);
                    if (defFileForDataGrid.ToLower() == theLoadedDefinitionFullFileName.ToLower())
                    {
                        IsDefinitionAlreadyPresent = true;
                        break;
                    }
                }

                if (!IsDefinitionAlreadyPresent)
                {
                    try
                    {
                        AddSopClassToDataGridFromDefinitionFile(theLoadedDefinitionFullFileName);
                    }
                    catch (Exception exception)
                    {
                        string theErrorText;

                        theErrorText = string.Format("Definition file {0} could not be interpreted while reading definition present in session:\n{1}\n\n", theLoadedDefinitionFullFileName, exception.Message);

                        _RichTextBoxInfo.AppendText(theErrorText);
                    }
                }
            }
        }
Example #11
0
        public void RemoveDefinitionFileDirectory()
        {
            string theSelectedDirectory;

            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();
            Dvtk.Sessions.DefinitionFileDirectoryList theDefinitionFileDirectoryList = theSession.Implementation.DefinitionManagement.DefinitionFileDirectoryList;
            theSelectedDirectory = (string)_ListBoxDefinitionFileDirectories.SelectedItem;
            theDefinitionFileDirectoryList.Remove(theSelectedDirectory);
            theSession.HasSessionChanged = true;
            // Notify the rest of the world.
            // This will implicitly also update this specify SOP classes tab.
            // TO DO
            Update();
            SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_OTHER);

            Notify(theSessionChange);
        }
Example #12
0
        /// <summary>
        /// The information from a definition file is added to the datagrid and possibly to the combo box.
        ///
        /// An excpetion is thrown when retrieving details for the definition file fails.
        /// </summary>
        /// <param name="theDefinitionFullFileName">the full file name of the definition file.</param>
        private void AddSopClassToDataGridFromDefinitionFile(string theDefinitionFullFileName)
        {
            DvtkApplicationLayer.Session        theSession = GetSessionTreeViewManager().GetSession();
            Dvtk.Sessions.DefinitionFileDetails theDefinitionFileDetails;

            // Try to get detailed information about this definition file.
            theDefinitionFileDetails = theSession.Implementation.DefinitionManagement.GetDefinitionFileDetails(theDefinitionFullFileName);

            // No excpetion thrown when calling GetDefinitionFileDetails (otherwise this statement would not have been reached)
            // so this is a valid definition file. Add it to the data frid.
            DefinitionFile theDataGridDefinitionFileInfo =
                new DefinitionFile(IsDefinitionFileLoaded(theDefinitionFullFileName),
                                   System.IO.Path.GetFileName(theDefinitionFullFileName),
                                   theDefinitionFileDetails.SOPClassName,
                                   theDefinitionFileDetails.SOPClassUID,
                                   theDefinitionFileDetails.ApplicationEntityName,
                                   theDefinitionFileDetails.ApplicationEntityVersion,
                                   System.IO.Path.GetDirectoryName(theDefinitionFullFileName));

            if (!theDefinitionFullFileName.Contains("AllDimseCommands.def"))
            {
                _DefinitionFilesInfoForDataGrid.Add(theDataGridDefinitionFileInfo);
            }

            // If the AE title - version does not yet exist in the combo box, add it.
            bool IsAeTitleVersionAlreadyInComboBox = false;

            foreach (AeTitleVersion theAeTitleVersion in _ComboBoxAeTitle.Items)
            {
                if ((theAeTitleVersion._AeTitle == theDefinitionFileDetails.ApplicationEntityName) &&
                    (theAeTitleVersion._Version == theDefinitionFileDetails.ApplicationEntityVersion))
                {
                    IsAeTitleVersionAlreadyInComboBox = true;
                    break;
                }
            }

            if (!IsAeTitleVersionAlreadyInComboBox)
            {
                AeTitleVersion theAeTitleVersion = new AeTitleVersion(theDefinitionFileDetails.ApplicationEntityName, theDefinitionFileDetails.ApplicationEntityVersion);
                _ComboBoxAeTitle.Items.Add(theAeTitleVersion);
            }
        }
Example #13
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="theSource"></param>
        /// <param name="theEvent"></param>
        public void TCM_Update(object theSource, object theEvent)
        {
            _TCM_UpdateCount++;

            if (theEvent is UpdateAll)
            {
                // Don't do anything.
                // The Session tree view will be completely updated, and
                // as an indirect result, this tab control will be updated
                // (if another tree view node is selected).
            }
            if (theEvent is SessionTreeViewSelectionChange)
            {
                // Update the tab control only if this event is from the
                // associated tree view.
                if (theSource == this)
                {
                    _SopClassesManager.RemoveDynamicDataBinding();
                    TCM_UpdateTabsShown();
                    TCM_UpdateTabContents();
                }
            }

            if (theEvent is SessionChange)
            {
                SessionChange theSessionChange = (SessionChange)theEvent;

                // The contents of a text box or numeric control has changed directly by the user.
                if (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.OTHER)
                {
                    // Invalidate the session used for updating the Session Information tab only if
                    // this event is from another tab control.
                    if (theSource != this)
                    {
                        if (_TCM_SessionUsedForContentsOfTabSessionInformation == theSessionChange.SessionApp)
                        {
                            // Invalidate this session, so the tab control will redraw when set as the active tab control.
                            _TCM_SessionUsedForContentsOfTabSessionInformation = null;
                        }
                    }
                }

                // The session has changed by something else then a direct contents change of a text box or numeric control.
                if ( (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.DESCRIPTION_DIR) ||
                    (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.RESULTS_DIR ) ||
                    (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.SCRIPTS_DIR ) )
                {
                    if (_TCM_SessionUsedForContentsOfTabSessionInformation == theSessionChange.SessionApp)
                    {
                        // Invalidate this session, so the tab control will redraw when set as the active tab control.
                        _TCM_SessionUsedForContentsOfTabSessionInformation = null;
                    }
                }

                // The SOP classes manager is only interested in changes of SOP classes related settings.
                // This is not important for the other tabs.
                if (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_OTHER)
                {
                    _SopClassesManager.SetSessionChanged(theSessionChange.SessionApp);
                }

                // The SOP classes manager is only interested in changes of SOP classes related settings.
                // This is not important for the other tabs.
                if (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_AE_TITLE_VERSION)
                {
                    if (theSource != this)
                    {
                        _SopClassesManager.SetSessionChanged(theSessionChange.SessionApp);
                    }
                }

                // The SOP classes manager is only interested in changes of SOP classes related settings.
                // This is not important for the other tabs.
                if (theSessionChange.SessionChangeSubTyp == SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_LOADED_STATE)
                {
                    if (theSource != this)
                    {
                        _SopClassesManager.SetSessionChanged(theSessionChange.SessionApp);
                    }
                }

                // Update the current visible tab control, only if necessary.
                TCM_UpdateTabContents();
            }

            if (theEvent is StartExecution)
            {
                if (theSource == this)
                {
                    DvtkApplicationLayer.Session tempSession = null ;
                    StartExecution theStartExecution = (StartExecution)theEvent;
                    // The tree node that is being executed.
                    TreeNode theTreeNode = ((StartExecution)theEvent).TreeNode;

                    // The tag of the tree node that is being executed.
                    Object theTreeNodeTag = theTreeNode.Tag;
                    if (theTreeNodeTag is DvtkApplicationLayer.PartOfSession)
                    {
                        DvtkApplicationLayer.PartOfSession partOfSession = theTreeNodeTag as DvtkApplicationLayer.PartOfSession;
                        tempSession = partOfSession.ParentSession;
                    }
                    else
                    {
                        tempSession = (DvtkApplicationLayer.MediaSession)theTreeNodeTag;
                    }
                    TCM_ClearActivityLogging();
                    tempSession.Implementation.ActivityReportEvent += _ActivityReportEventHandler;

                    // For some strange reason, if the session tree control is disabled and this statement
                    // is not present, switching to another application and back will result in a disabled
                    // application (when the StartEmulatorExecution is received).
                    TabControl.Focus();
                }
            }

            if (theEvent is EndExecution)
            {
                if (theSource == this)
                {
                    DvtkApplicationLayer.Session tempSession = null ;
                    EndExecution theEndExecution = (EndExecution)theEvent;
                    Object theTreeNodeTag = ((EndExecution)theEndExecution)._Tag;

                    if (theTreeNodeTag is DvtkApplicationLayer.PartOfSession)
                    {
                        DvtkApplicationLayer.PartOfSession partOfSession = theTreeNodeTag as DvtkApplicationLayer.PartOfSession;
                        tempSession = partOfSession.ParentSession ;
                    }
                    else
                    {
                        tempSession = (DvtkApplicationLayer.MediaSession)theTreeNodeTag;
                    }
                    tempSession.Implementation.ActivityReportEvent -= _ActivityReportEventHandler;
                }
            }
            if (theEvent is SessionRemovedEvent)
            {
                TCM_UpdateTabsShown();

                TCM_UpdateTabContents();
            }
            _TCM_UpdateCount--;
        }
Example #14
0
        public void UpdateSessionNodeTextMainNodeOnly(TreeNode theTreeNode, Session theSession)
        {
            _MainForm = (MainForm)parentForm._MainForm;
            bool isSessionExecuting = _MainForm.IsExecuting(theSession);
            //bool isSessionExecuting = theSession.IsExecute;
            bool isSessionExecutingInOtherSessionTreeView = (isSessionExecuting && (theSession != GetExecutingSession()));

            theTreeNode.Text = System.IO.Path.GetFileName(theSession.SessionFileName);

            if ( (theSession is ScriptSession) ||
                (theSession is EmulatorSession)
                ) {
                if (isSessionExecutingInOtherSessionTreeView) {
                    theTreeNode.Text+= " (disabled)";
                }
            }

            if (theSession is DvtkApplicationLayer.MediaSession) {
                // If this session is executing...
                if (isSessionExecuting) {
                    // If the executing session is executed by this session tree view...
                    if (theSession == GetExecutingSession()) {
                        theTreeNode.Text+= " (executing)";
                    }
                        // If the executing session is not executed by this session tree view...
                    else {
                        theTreeNode.Text+= "(disabled)";
                    }
                }
            }

            if (theSession.GetSessionChanged(theSession)) {
                theTreeNode.Text+= " *";
            }
        }
Example #15
0
 public void SetSessionChanged(DvtkApplicationLayer.Session theSession)
 {
     if (theSession == _SessionUsedForContentsOfTabSpecifySopClasses)
     {
         _SessionUsedForContentsOfTabSpecifySopClasses = null;
     }
 }
Example #16
0
 public SessionRemovedEvent(DvtkApplicationLayer.Session theSession)
 {
     _Session = theSession;
 }
Example #17
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="session"></param>
 /// <param name="emulatorName"></param>
 public Emulator(Session session, String emulatorName)
     : base(session)
 {
     this.emulatorName = emulatorName;
 }
Example #18
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public StorageSCUEmulator(Session session, String emulatorName)
     : base(session , emulatorName)
 {
 }
        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;
                    }
                }
            }
        }
Example #20
0
 public SessionReplaced(DvtkApplicationLayer.Session theOldSession, DvtkApplicationLayer.Session theNewSession)
 {
     _OldSession = theOldSession;
     _NewSession = theNewSession;
 }
Example #21
0
        private ArrayList GetVisibleScripts(Session session)
        {
            ArrayList visibleScripts = new ArrayList();
            ScriptSession scriptSession = null;
            string scriptRootDirectory = "";
            DirectoryInfo directoryInfo = null;
            FileInfo[] filesInfo;

            scriptSession = (ScriptSession)session;
            scriptRootDirectory = scriptSession.DicomScriptRootDirectory;
            directoryInfo = new DirectoryInfo(scriptRootDirectory);

            if (directoryInfo.Exists)
            {
                filesInfo = directoryInfo.GetFiles();

                foreach (FileInfo fileInfo in filesInfo)
                {
                    bool showScriptFile = false;
                    string fileExtension = fileInfo.Extension.ToLower();

                    if ((fileExtension == ".ds") && (_MainForm._UserSettings.ShowDicomScripts))
                    {
                        showScriptFile = true;
                    }
                    else if ((fileExtension == ".dss") && (_MainForm._UserSettings.ShowDicomSuperScripts))
                    {
                        showScriptFile = true;
                    }
                    else if ((fileExtension == ".vbs") && (_MainForm._UserSettings.ShowVisualBasicScripts))
                    {
                        showScriptFile = true;
                    }
                    else
                    {
                        showScriptFile = false;
                    }

                    if (showScriptFile)
                    {
                        visibleScripts.Add(fileInfo.Name);
                    }
                }
            }

            return(visibleScripts);
        }
        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;
                    }
                }
            }
        }
Example #23
0
        public void UpdateSessionNode(TreeNode sessionTreeNode, Session session)
        {
            UpdateSessionNodeTextMainNodeOnly(sessionTreeNode, session);

            if (session is ScriptSession) {
                UpdateScriptSessionNode(sessionTreeNode, session as ScriptSession);
            }

            if (session is DvtkApplicationLayer.MediaSession) {
                UpdateMediaSessionNode(sessionTreeNode, session as DvtkApplicationLayer.MediaSession);
            }
            if (session is EmulatorSession) {
                UpdateEmulatorSessionNode(sessionTreeNode, session as EmulatorSession);
            }
        }
Example #24
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public PrintScpEmulator(Session session, String emulatorName)
     : base(session , emulatorName)
 {
 }
Example #25
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public MediaFile(Session session, String mediaFileName)
     : base(session)
 {
     this.mediaFileName = mediaFileName;
 }
Example #26
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="session"></param>
 /// <param name="scriptFileName"></param>
 public DicomScript(Session session, String scriptFileName)
     : base(session, scriptFileName)
 {
 }
Example #27
0
 public SessionChange(DvtkApplicationLayer.Session theSession, SessionChangeSubTypEnum theSessionChangeSubTyp)
 {
     session = theSession;
     _SessionChangeSubTyp = theSessionChangeSubTyp;
 }
Example #28
0
 /// <summary>
 /// Constructor .
 /// </summary>
 /// <param name="session"> DvtkApplicationLayer.Sesion</param>
 public PartOfSession(Session session)
 {
     this.session = session;
 }
Example #29
0
        /// <summary>
        /// When moving the mouse over other "loaded" check box while keeping the left mouse button pressed,
        /// change the "loaded" state to the new state when the left mouse button was pressed.
        /// </summary>
        /// <param name="e"></param>
        public void DataGrid_MouseMove(System.Windows.Forms.MouseEventArgs e)
        {
            DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();

            if (e.Button == MouseButtons.Left)
            {
                System.Windows.Forms.DataGrid.HitTestInfo theHitTestInfo;

                theHitTestInfo = _DataGridSopClasses.HitTest(e.X, e.Y);

                switch (theHitTestInfo.Type)
                {
                case System.Windows.Forms.DataGrid.HitTestType.Cell:
                    // If this is the "loaded" column...
                    if (theHitTestInfo.Column == 0)
                    {
                        // If another "loaded" check box is pointed to, not the one where the state has
                        // last been changed...
                        if (theHitTestInfo.Row != _MouseEventInfoForDataGrid_LoadedStateChangedForRow)
                        {
                            DefinitionFile theDefinitionFile     = (DefinitionFile)_DefinitionFilesInfoForDataGrid[theHitTestInfo.Row];
                            bool           theCurrentLoadedState = theDefinitionFile.Loaded;

                            // Only if the state will change...
                            if (theCurrentLoadedState != _MouseEventInfoForDataGrid_LoadedStatedAfterMouseDown)
                            {
                                // Get the column style for the "loaded" column.
                                DataGridColumnStyle theDataGridColumnStyle;
                                theDataGridColumnStyle = _DataGridSopClasses.TableStyles[0].GridColumnStyles[0];

                                // Change the "loaded" stated in _DefinitionFilesInfoForDataGrid and the data grid itself.
                                _DataGridSopClasses.BeginEdit(theDataGridColumnStyle, theHitTestInfo.Row);
                                theDefinitionFile.Loaded = _MouseEventInfoForDataGrid_LoadedStatedAfterMouseDown;
                                _DataGridSopClasses.EndEdit(theDataGridColumnStyle, theHitTestInfo.Row, false);

                                // Change the "loaded" state in the session object.
                                string theFullFileName = System.IO.Path.Combine(theDefinitionFile.DefinitionRoot, theDefinitionFile.Filename);

                                if (_MouseEventInfoForDataGrid_LoadedStatedAfterMouseDown)
                                {
                                    // The definition file was not loaded yet. Load it now.
                                    theSession.Implementation.DefinitionManagement.LoadDefinitionFile(theFullFileName);
                                }
                                else
                                {
                                    // The definition file was loaded. Unload it now.
                                    theSession.Implementation.DefinitionManagement.UnLoadDefinitionFile(theFullFileName);
                                }

                                // Remember the cell we've changed. We don't want to change the loaded
                                // state with each minor mouse move.
                                _MouseEventInfoForDataGrid_LoadedStateChangedForRow = theHitTestInfo.Row;

                                // Notify the rest of the world.
                                // TO DO
                                SessionChange theSessionChange = new SessionChange(theSession, SessionChange.SessionChangeSubTypEnum.SOP_CLASSES_LOADED_STATE);
                                Notify(theSessionChange);
                            }
                            else
                            // State will not change. The cell under the mouse will not be selected. This
                            // results in scrolling that will not work when the mouse is moved to the bottom
                            // of the datagrid.
                            //
                            // To solve this, explicitly make the cell under the mouse selected.
                            {
                                DataGridCell currentSelectedCell = _DataGridSopClasses.CurrentCell;
                                DataGridCell newSelectedCell     = new DataGridCell(theHitTestInfo.Row, currentSelectedCell.ColumnNumber);

                                _DataGridSopClasses.CurrentCell = newSelectedCell;
                            }
                        }
                    }
                    break;
                }
            }
        }
Example #30
0
 private static void DisplayResultCounters(Session session)
 {
     if ((session.Implementation.CountingTarget.TotalNrOfValidationErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfUserErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfGeneralErrors == 0)) {
         Console.WriteLine ("");
         Console.WriteLine("RESULT: PASSED");
     }
     else {
         Console.WriteLine ("");
         Console.WriteLine("RESULT: FAILED");
     }
     Console.WriteLine("Number of Validation Errors: {0} - Number of Validation Warnings: {1}",
         session.Implementation.CountingTarget.TotalNrOfValidationErrors,
         session.Implementation.CountingTarget.TotalNrOfValidationWarnings);
     Console.WriteLine("Number of User Errors: {0} - Number of User Warnings: {1}",
         session.Implementation.CountingTarget.TotalNrOfUserErrors,
         session.Implementation.CountingTarget.TotalNrOfUserWarnings);
     Console.WriteLine("Number of General Errors: {0} - Number of General Warnings: {1}",
         session.Implementation.CountingTarget.TotalNrOfGeneralErrors,
         session.Implementation.CountingTarget.TotalNrOfGeneralWarnings);
     Console.WriteLine("");
 }
Example #31
0
 public SessionRemovedEvent(DvtkApplicationLayer.Session theSession)
 {
     _Session = theSession;
 }
Example #32
0
 public SessionChange(DvtkApplicationLayer.Session theSession, SessionChangeSubTypEnum theSessionChangeSubTyp)
 {
     session = theSession;
     _SessionChangeSubTyp = theSessionChangeSubTyp;
 }
Example #33
0
        private void CheckBoxSecureConnection_CheckedChanged(object sender, System.EventArgs e)
        {
            // Only react when the user has made changes, not when the TCM_Update method has been called.
            if (_TCM_UpdateCount == 0)
            {
                Dvtk.Sessions.ISecure theISecure = GetSelectedSessionNew().Implementation as Dvtk.Sessions.ISecure;

                if (theISecure == null)
                {
                    // Sanity check.
                    Debug.Assert(false);
                }
                else
                {
                    theISecure.SecuritySettings.SecureSocketsEnabled = CheckBoxSecureConnection.Checked;

                    _TCM_SessionUsedForContentsOfTabSessionInformation = null;
                    TCM_UpdateTabSessionInformation();

                    SessionChange theSessionChange = new SessionChange(GetSelectedSessionNew(), SessionChange.SessionChangeSubTypEnum.OTHER);
                    Notify(theSessionChange);
                }
            }
        }
Example #34
0
 public SessionReplaced(DvtkApplicationLayer.Session theOldSession, DvtkApplicationLayer.Session theNewSession)
 {
     _OldSession = theOldSession;
     _NewSession = theNewSession;
 }
Example #35
0
        private void TCM_UpdateTabSessionInformation()
        {
            _TCM_UpdateCount++;
            bool Update = false;
            DvtkApplicationLayer.Session theSelectedSession = GetSession();
            // If this session tab has not yet been filled, fill it.
            if (_TCM_SessionUsedForContentsOfTabSessionInformation == null)
            {
                Update = true;
            }
            else
            {
                // If the current session is not equal to the session used to fill the session information tab
                // last time, fill it again.
                if (_TCM_SessionUsedForContentsOfTabSessionInformation != theSelectedSession)
                {
                    Update = true;
                }
            }

            // Update the complete contents of the session information tab.
            if (Update)
            {
                // General session properties.
                if (theSelectedSession is DvtkApplicationLayer.ScriptSession)
                {
                    TextBoxSessionType.Text = "Script";
                }
                if (theSelectedSession is DvtkApplicationLayer.MediaSession)
                {
                    TextBoxSessionType.Text = "Media";
                }
                if (theSelectedSession is DvtkApplicationLayer.EmulatorSession)
                {
                    TextBoxSessionType.Text = "Emulator";
                }
                TextBoxSessionTitle.Text = theSelectedSession.SessionTitle;
                NumericSessonID.Value = theSelectedSession.SessionId;
                TextBoxTestedBy.Text = theSelectedSession.TestedBy;
                TextBoxResultsRoot.Text = theSelectedSession.ResultsRootDirectory;
                TextBoxDataRoot.Text = theSelectedSession.DataDirectory;
                if (theSelectedSession is DvtkApplicationLayer.ScriptSession)
                {
                    DvtkApplicationLayer.ScriptSession theSelectedScriptSession;
                    theSelectedScriptSession = (DvtkApplicationLayer.ScriptSession)theSelectedSession;

                    LabelScriptsDir.Visible = true;
                    TextBoxScriptRoot.Visible = true;
                    ButtonBrowseScriptsDir.Visible = true;
                    LabelDescriptionDir.Visible = true;
                    TextBoxDescriptionRoot.Visible = true;
                    ButtonBrowseDescriptionDir.Visible = true;

                    TextBoxScriptRoot.Text = theSelectedScriptSession.DicomScriptRootDirectory;
                    TextBoxDescriptionRoot.Text = theSelectedScriptSession.DescriptionDirectory;
                    CheckBoxDefineSQLength.Checked = theSelectedScriptSession.DefineSqLength;
                    CheckBoxAddGroupLengths.Checked = theSelectedScriptSession.AddGroupLength;
                    TextBoxDVTImplClassUID.Text = theSelectedScriptSession.DvtImplementationClassUid;
                    TextBoxDVTImplVersionName.Text = theSelectedScriptSession.DvtImplementationVersionName;
                    TextBoxDVTAETitle.Text = theSelectedScriptSession.DvtAeTitle;
                    NumericDVTListenPort.Value = theSelectedScriptSession.DvtPort;
                    NumericDVTTimeOut.Value = theSelectedScriptSession.DvtSocketTimeout;
                    NumericDVTMaxPDU.Value = theSelectedScriptSession.DvtMaximumLengthReceived;
                    PanelDVTRoleSettingsTitle.Visible = true;
                    if (MinDVTRoleSettings.Visible)
                    {
                        PanelDVTRoleSettingsContent.Visible = true;
                    }
                    TextBoxSUTImplClassUID.Text = theSelectedScriptSession.SutImplementationClassUid;
                    TextBoxSUTImplVersionName.Text = theSelectedScriptSession.SutImplementationVersionName;
                    TextBoxSUTAETitle.Text = theSelectedScriptSession.SutAeTitle;
                    NumericSUTListenPort.Value = theSelectedScriptSession.SutPort;
                    TextBoxSUTTCPIPAddress.Text = theSelectedScriptSession.SutHostName;
                    NumericSUTMaxPDU.Value = theSelectedScriptSession.SutMaximumLengthReceived;
                    PanelSUTSettingTitle.Visible = true;
                    if (MinSUTSettings.Visible)
                    {
                        PanelSUTSettingContent.Visible = true;
                    }
                }
                else
                {
                    LabelScriptsDir.Visible = false;
                    TextBoxScriptRoot.Visible = false;
                    ButtonBrowseScriptsDir.Visible = false;
                    LabelDescriptionDir.Visible = false;
                    TextBoxDescriptionRoot.Visible = false;
                    ButtonBrowseDescriptionDir.Visible = false;

                    PanelDVTRoleSettingsTitle.Visible = false;
                    PanelDVTRoleSettingsContent.Visible = false;
                }

                CheckBoxGenerateDetailedValidationResults.Checked = theSelectedSession.DetailedValidationResults;

                if (theSelectedSession is DvtkApplicationLayer.MediaSession)
                {
                    CheckBoxDefineSQLength.Visible = false;
                    CheckBoxAddGroupLengths.Visible = false;
                    PanelDVTRoleSettingsContent.Visible = false;
                    PanelDVTRoleSettingsTitle.Visible = false;
                    PanelSUTSettingContent.Visible = false;
                    PanelSUTSettingTitle.Visible = false;
                }
                else
                {
                    CheckBoxDefineSQLength.Visible = true;
                    CheckBoxAddGroupLengths.Visible = true;
                }

                switch(theSelectedSession.Mode)
                {
                    case DvtkApplicationLayer.Session.StorageMode.AsDataSet:
                        ComboBoxStorageMode.SelectedIndex = 0;
                        break;

                    case DvtkApplicationLayer.Session.StorageMode.AsMedia:
                        ComboBoxStorageMode.SelectedIndex = 1;
                        break;

                    case DvtkApplicationLayer.Session.StorageMode.AsMediaOnly:
                        ComboBoxStorageMode.SelectedIndex = 2;
                        break;

                    case DvtkApplicationLayer.Session.StorageMode.NoStorage:
                        ComboBoxStorageMode.SelectedIndex = 3;
                        break;

                    default:
                        // Not supposed to get here.
                        Debug.Assert(false);
                        break;
                }

                if (theSelectedSession is DvtkApplicationLayer.EmulatorSession)
                {
                    DvtkApplicationLayer.EmulatorSession theSelectedEmulatorSession;
                    theSelectedEmulatorSession = (DvtkApplicationLayer.EmulatorSession)theSelectedSession;

                    ButtonSpecifyTransferSyntaxes.Visible = true;
                    LabelSpecifyTransferSyntaxes.Visible = true;
                    CheckBoxDefineSQLength.Checked = theSelectedEmulatorSession.DefineSqLength;
                    CheckBoxAddGroupLengths.Checked = theSelectedEmulatorSession.AddGroupLength;
                    TextBoxDVTImplClassUID.Text = theSelectedEmulatorSession.DvtImplementationClassUid;
                    TextBoxDVTImplVersionName.Text = theSelectedEmulatorSession.DvtImplementationVersionName;
                    TextBoxDVTAETitle.Text = theSelectedEmulatorSession.DvtAeTitle;
                    NumericDVTListenPort.Value = theSelectedEmulatorSession.DvtPort;
                    NumericDVTTimeOut.Value = theSelectedEmulatorSession.DvtSocketTimeout;
                    NumericDVTMaxPDU.Value = theSelectedEmulatorSession.DvtMaximumLengthReceived;
                    PanelDVTRoleSettingsTitle.Visible = true;
                    if (MinDVTRoleSettings.Visible)
                    {
                        PanelDVTRoleSettingsContent.Visible = true;
                    }
                    TextBoxSUTImplClassUID.Text = theSelectedEmulatorSession.SutImplementationClassUid;
                    TextBoxSUTImplVersionName.Text = theSelectedEmulatorSession.SutImplementationVersionName;
                    TextBoxSUTAETitle.Text = theSelectedEmulatorSession.SutAeTitle;
                    NumericSUTListenPort.Value = theSelectedEmulatorSession.SutPort;
                    TextBoxSUTTCPIPAddress.Text = theSelectedEmulatorSession.SutHostName;
                    NumericSUTMaxPDU.Value = theSelectedEmulatorSession.SutMaximumLengthReceived;

                    PanelSUTSettingTitle.Visible = true;
                    if (MinSUTSettings.Visible)
                    {
                        PanelSUTSettingContent.Visible = true;
                    }
                }
                else
                {
                    ButtonSpecifyTransferSyntaxes.Visible = false;
                    LabelSpecifyTransferSyntaxes.Visible = false;
                }
                Dvtk.Sessions.LogLevelFlags flag = (Dvtk.Sessions.LogLevelFlags)((GetSelectedSessionNew().LogLevelMask));
                CheckBoxLogRelation.Checked = ((flag & Dvtk.Sessions.LogLevelFlags.ImageRelation) == Dvtk.Sessions.LogLevelFlags.ImageRelation);
                CheckBoxDisplayCondition.Checked = theSelectedSession.DisplayConditionText;

                // Security settings.
                if (theSelectedSession.Implementation is Dvtk.Sessions.ISecure)
                {
                    Dvtk.Sessions.ISecuritySettings theISecuritySettings = null;

                    theISecuritySettings = (theSelectedSession.Implementation as Dvtk.Sessions.ISecure).SecuritySettings;

                    CheckBoxSecureConnection.Checked = theISecuritySettings.SecureSocketsEnabled;

                    if (CheckBoxSecureConnection.Checked)
                    {
                        if (_TCM_ShowMinSecuritySettings)
                        {
                            PanelSecuritySettingsTitle.Visible = true;
                            PanelSecuritySettingsContent.Visible = true;

                            MinSecuritySettings.Visible = true;
                            MaxSecuritySettings.Visible = false;

                            CheckBoxCheckRemoteCertificates.Checked = theISecuritySettings.CheckRemoteCertificate;
                            CheckBoxCacheSecureSessions.Checked = theISecuritySettings.CacheTlsSessions;
                            CheckBoxTLS.Checked = ((theISecuritySettings.TlsVersionFlags & Dvtk.Sessions.TlsVersionFlags.TLS_VERSION_TLSv1) != 0);
                            CheckBoxSSL.Checked = ((theISecuritySettings.TlsVersionFlags & Dvtk.Sessions.TlsVersionFlags.TLS_VERSION_SSLv3) != 0);
                            CheckBoxAuthenticationDSA.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_AUTHENICATION_METHOD_DSA) != 0);
                            CheckBoxAuthenticationRSA.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_AUTHENICATION_METHOD_RSA) != 0);
                            CheckBoxDataIntegrityMD5.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_DATA_INTEGRITY_METHOD_MD5) != 0);
                            CheckBoxDataIntegritySHA.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_DATA_INTEGRITY_METHOD_SHA1) != 0);
                            CheckBoxEncryptionNone.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_ENCRYPTION_METHOD_NONE) != 0);
                            CheckBoxEncryptionTripleDES.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_ENCRYPTION_METHOD_3DES) != 0);
                            CheckBoxEncryptionAES128.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_ENCRYPTION_METHOD_AES128) != 0);
                            CheckBoxEncryptionAES256.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_ENCRYPTION_METHOD_AES256) != 0);
                            CheckBoxKeyExchangeDH.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_KEY_EXCHANGE_METHOD_DH) != 0);
                            CheckBoxKeyExchangeRSA.Checked = ((theISecuritySettings.CipherFlags & Dvtk.Sessions.CipherFlags.TLS_KEY_EXCHANGE_METHOD_RSA) != 0);
                            TextBoxTrustedCertificatesFile.Text = theISecuritySettings.CertificateFileName;
                            TextBoxSecurityCredentialsFile.Text = theISecuritySettings.CredentialsFileName;
                        }
                        else
                        {
                            PanelSecuritySettingsContent.Visible = false;

                            MinSecuritySettings.Visible = false;
                            MaxSecuritySettings.Visible = true;
                        }
                    }
                    else
                    {
                        PanelSecuritySettingsTitle.Visible = true;
                        PanelSecuritySettingsContent.Visible = false;

                        MinSecuritySettings.Visible = false;
                        MaxSecuritySettings.Visible = false;
                    }
                }
                else
                {
                    PanelSecuritySettingsTitle.Visible = false;
                    PanelSecuritySettingsContent.Visible = false;
                }

                _TCM_SessionUsedForContentsOfTabSessionInformation = theSelectedSession;
            }

            _TCM_UpdateCount-- ;
        }
Example #36
0
        /// <summary>
        /// Update the Specify SOP classes tab.
        /// </summary>
        public void Update()
        {
            if (_SessionUsedForContentsOfTabSpecifySopClasses == GetSessionTreeViewManager().GetSession())
            {
                // No need to update, this tab already contains the correct session information.
                _DataGridSopClasses.SetDataBinding(_DefinitionFilesInfoForDataGrid, "");
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;

                DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();
                Dvtk.Sessions.DefinitionFileDirectoryList theDefinitionFileDirectoryList = theSession.Implementation.DefinitionManagement.DefinitionFileDirectoryList;

                // Update the definition file directories list box.
                _ListBoxDefinitionFileDirectories.Items.Clear();

                UpdateRemoveButton();

                foreach(string theDefinitionFileDirectory in theDefinitionFileDirectoryList)
                {
                    _ListBoxDefinitionFileDirectories.Items.Add(theDefinitionFileDirectory);
                }

                // Update the SOP classes data grid.
                // For every definition file directory, use the .def files present in the directory.
                _RichTextBoxInfo.Clear();
                _ComboBoxAeTitle.Items.Clear();
                _ComboBoxAeTitle.Items.Add(_DefaultAeTitleVersion);
                _DefinitionFilesInfoForDataGrid.Clear();

                // Add the correct information to the datagrid by inspecting the definition directory.
                // When doing this, also fill the combobox with available ae title - version combinations.
                AddSopClassesToDataGridFromDirectories();

                // Add the correct information to the datagrid by inspecting the loaded definitions.
                // When doing this, also fill the combobox with available ae title - version combinations.
                // Only add an entry if it does not already exist.
                AddSopClassesToDataGridFromLoadedDefinitions();

                // Make the correct AE title - version in the combo box the current one.
                SetSelectedAeTitleVersion();

                // Workaround for following problem:
                // If the SOP classes tab has already been filled, and another session contains less
                // records for the datagrid, windows gets confused and thinks there are more records
                // then actually present in _DefinitionFilesInfoForDataGrid resulting in an assertion.
                _DataGridSopClasses.SetDataBinding(null, "");

                // Actually refresh the data grid.
                _DataGridSopClasses.SetDataBinding(_DefinitionFilesInfoForDataGrid, "");
                //_DataGridSopClasses.DataSource = _DefinitionFilesInfoForDataGrid;

                _DataGridSopClasses.Refresh();

                _SessionUsedForContentsOfTabSpecifySopClasses = GetSessionTreeViewManager().GetSession();

                Cursor.Current = Cursors.Default;
            }
        }
Example #37
0
        /// <summary>
        /// Update the Specify SOP classes tab.
        /// </summary>
        public void Update()
        {
            if (_SessionUsedForContentsOfTabSpecifySopClasses == GetSessionTreeViewManager().GetSession())
            {
                // No need to update, this tab already contains the correct session information.
                _DataGridSopClasses.SetDataBinding(_DefinitionFilesInfoForDataGrid, "");
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;

                DvtkApplicationLayer.Session theSession = GetSessionTreeViewManager().GetSession();
                Dvtk.Sessions.DefinitionFileDirectoryList theDefinitionFileDirectoryList = theSession.Implementation.DefinitionManagement.DefinitionFileDirectoryList;


                // Update the definition file directories list box.
                _ListBoxDefinitionFileDirectories.Items.Clear();

                UpdateRemoveButton();

                foreach (string theDefinitionFileDirectory in theDefinitionFileDirectoryList)
                {
                    _ListBoxDefinitionFileDirectories.Items.Add(theDefinitionFileDirectory);
                }

                // Update the SOP classes data grid.
                // For every definition file directory, use the .def files present in the directory.
                _RichTextBoxInfo.Clear();
                _ComboBoxAeTitle.Items.Clear();
                _ComboBoxAeTitle.Items.Add(_DefaultAeTitleVersion);
                _DefinitionFilesInfoForDataGrid.Clear();

                // Add the correct information to the datagrid by inspecting the definition directory.
                // When doing this, also fill the combobox with available ae title - version combinations.
                AddSopClassesToDataGridFromDirectories();

                // Add the correct information to the datagrid by inspecting the loaded definitions.
                // When doing this, also fill the combobox with available ae title - version combinations.
                // Only add an entry if it does not already exist.
                AddSopClassesToDataGridFromLoadedDefinitions();

                // Make the correct AE title - version in the combo box the current one.
                SetSelectedAeTitleVersion();

                // Workaround for following problem:
                // If the SOP classes tab has already been filled, and another session contains less
                // records for the datagrid, windows gets confused and thinks there are more records
                // then actually present in _DefinitionFilesInfoForDataGrid resulting in an assertion.
                _DataGridSopClasses.SetDataBinding(null, "");

                // Actually refresh the data grid.
                _DataGridSopClasses.SetDataBinding(_DefinitionFilesInfoForDataGrid, "");
                //_DataGridSopClasses.DataSource = _DefinitionFilesInfoForDataGrid;

                _DataGridSopClasses.Refresh();

                _SessionUsedForContentsOfTabSpecifySopClasses = GetSessionTreeViewManager().GetSession();

                Cursor.Current = Cursors.Default;
            }
        }
Example #38
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public Result(Session session)
     : base(session)
 {
 }
Example #39
0
 private static void DetermineExitCode(Session session)
 {
     if ((session.Implementation.CountingTarget.TotalNrOfValidationErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfUserErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfGeneralErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfValidationWarnings == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfUserWarnings == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfGeneralWarnings == 0))
     {
         // No errors / no warnings
         _exitCode = 0;
     }
     else if ((session.Implementation.CountingTarget.TotalNrOfValidationErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfUserErrors == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfGeneralErrors == 0))
     {
         // No errors / some warnings
         _exitCode = -1;
     }
     else if ((session.Implementation.CountingTarget.TotalNrOfValidationWarnings == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfUserWarnings == 0) &&
         (session.Implementation.CountingTarget.TotalNrOfGeneralWarnings == 0))
     {
         // Some errors / no warnings
         _exitCode = -2;
     }
     else
     {
         // Some errors and warnings
         _exitCode = -3;
     }
 }