Ejemplo n.º 1
0
        public SessionTreeViewManager(ProjectForm2 theParentForm, Project theProject, System.Windows.Forms.TreeView theSessionTreeView)
        {
            _ParentForm = theParentForm;
            _MainForm = (MainForm)_ParentForm._MainForm;
            _Project = theProject;
            _SessionTreeView = theSessionTreeView;

            _StorageSCUEmulatorFormAsyncCallback = new System.AsyncCallback(this.ResultsFromExecutingEmulatorStorageScuAsynchronously);
            _StorageSCUEmulatorForm = new StorageSCUEmulatorForm(_StorageSCUEmulatorFormAsyncCallback);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="theDataGridSopClasses">The DataGrid that is managed by this class.</param>
        /// <param name="theSessionTreeViewManager">The associated session tree view manager.</param>
        public SopClassesManager(ProjectForm2 theProjectForm2, System.Windows.Forms.DataGrid theDataGridSopClasses, System.Windows.Forms.ComboBox theComboBoxAeTitle, System.Windows.Forms.ListBox theListBoxDefinitionFileDirectories, System.Windows.Forms.RichTextBox theRichTextBoxInfo, SessionTreeViewManager theSessionTreeViewManager, System.Windows.Forms.Button theButtonRemoveDirectory)
        {
            _ProjectForm2 = theProjectForm2;
            _DataGridSopClasses = theDataGridSopClasses;
            _ComboBoxAeTitle = theComboBoxAeTitle;
            _ListBoxDefinitionFileDirectories = theListBoxDefinitionFileDirectories;
            _RichTextBoxInfo = theRichTextBoxInfo;
            _SessionTreeViewManager = theSessionTreeViewManager;
            _ButtonRemoveDirectory = theButtonRemoveDirectory;

            _DefinitionFilesInfoForDataGrid = new ArrayList();
            _DefaultAeTitleVersion = new AeTitleVersion("DICOM", "3.0");
            _theDefinitionFileTextColumn = new DataGridTextBoxColumn();

            Initialize();
        }
Ejemplo n.º 3
0
        private void ActionOpenProjectOrSession()
        {
            bool hasUserCancelledOperation = false;

            // If unsaved changes exist for the project and/or sessions, ask the user
            // whether to save them.

            if ((_Project.IsProjectConstructed) && (_Project.AreProjectOrSessionsChanged()))
            {
                _Project.Save(true);
                hasUserCancelledOperation = _Project._HasUserCancelledLastOperation;
            }

            if (!hasUserCancelledOperation)
            {
                if (this.DialogOpenProject.ShowDialog (this) == DialogResult.OK)
                {
                    ProjectForm2 child_project;

                    if (_Project.IsProjectConstructed)
                    {
                        // User already decided what to save.
                        _Project.Close(false);

                        CloseAlProjectForms();
                    }

                    FileInfo file = new FileInfo(this.DialogOpenProject.FileName);

                    if (file.Extension == ".pdvt")
                    {
                        _Project.display_message = new Dvt.Project.CallBackMessageDisplay (this.CallBackMessageDisplay);
                        _Project.Load(this.DialogOpenProject.FileName);
                    }

                    if (file.Extension == ".ses")
                    {
                        _Project.display_message = new Dvt.Project.CallBackMessageDisplay (this.CallBackMessageDisplay);
                        _Project.New(this.DialogOpenProject.FileName.Replace (".ses", ".pdvt"));
                        _Project.AddSession (this.DialogOpenProject.FileName);
                    }
                    child_project = new ProjectForm2(_Project, this);

                    child_project.MdiParent = this;

                    child_project.Show();
                    child_project.Activate();

                    // Make the project form update itself completely.
                    child_project.Update(this, new UpdateAll());
                }
                else
                {
                    // No project or session is opened, but
                    // changed project and/or changes sessions may have been saved.
                    Notify(this, new Saved());
                }

                this.UpdateUIControls ();
            }
        }
Ejemplo n.º 4
0
        private void ActionNew()
        {
            bool hasUserCancelledOperation = false;
            WizardNew   wizard;

            // If unsaved changes exist for the project and/or sessions, ask the user
            // whether to save them.
            if (_Project.AreProjectOrSessionsChanged())
            {
                // The user decides whether or what to save.
                _Project.Save(true);
                hasUserCancelledOperation = _Project.HasUserCancelledLastOperation();
            }

            if (!hasUserCancelledOperation)
            {
                wizard = new WizardNew (WizardNew.StartPage.project);
                wizard.Text = "New Project Wizard";

                wizard.ShowDialog(this);

                if (wizard.has_created_project)
                {
                    ProjectForm2     child_project;

                    // If a project is loaded, close the project and close all project forms
                    if (_Project.IsProjectConstructed)
                    {
                        // The user already has indicated which unsaved changes needed to be saved,
                        // so don't ask a second time.
                        _Project.Close(false);

                        CloseAlProjectForms();
                    }

                    wizard.ConstructAndSaveProject(_Project);

                    child_project = new ProjectForm2 (_Project, this);
                    child_project.MdiParent = this;

                    child_project.Show ();
                    child_project.Activate();

                    // Make the project form update itself completely.
                    child_project.Update(this, new UpdateAll());

                }
                else
                {
                    // No project is created using the wizard, but
                    // changed project and/or changes sessions may have been saved.
                    Notify(this, new Saved());
                }

                UpdateUIControls ();
            }
        }
Ejemplo n.º 5
0
        public bool DeleteProjectView(ProjectForm2   project_view)
        {
            if (this.MdiChildren.Length == 1)
                // The user wants to close the last project form.
            {
                // User decides what to save.
                _Project.Save(false);

                Notify(this, new Saved());

                if (_Project.AreProjectOrSessionsChanged())
                {
                    return false;
                }

                // ProjectForm2 active_form = (ProjectForm2) this.ActiveMdiChild;

                _Project.Close(false);
            }
            this.UpdateUIControls ();
            return true;
        }
Ejemplo n.º 6
0
        private void WindowNewProjectView_Click(object sender, System.EventArgs e)
        {
            ProjectForm2 theChildProjectForm = new ProjectForm2(_Project, this);

            theChildProjectForm.MdiParent = this;

            theChildProjectForm.Show ();
            theChildProjectForm.Activate();

            // Make the project form update itself completely.
            UpdateAll theUpdateAll = new UpdateAll();
            theChildProjectForm.Update(this, theUpdateAll);

            this.UpdateUIControls ();
        }
Ejemplo n.º 7
0
        private void WindowNewProjectViewAndTile_Click(object sender, System.EventArgs e)
        {
            ProjectForm2 theChildProjectForm = new ProjectForm2(_Project, this);

            theChildProjectForm.MdiParent = this;

            // Note: Show is not robust enough for MDI childs with window state maximized.
            // Workaround: Forcing all existing child windows to window state normal before show.
            foreach (object theObject in this.MdiChildren)
            {
                ProjectForm2 theProjectForm2 = theObject as ProjectForm2;
                if (theProjectForm2 != null)
                {
                    theProjectForm2.WindowState = FormWindowState.Normal;
                }
            }

            theChildProjectForm.Show ();
            theChildProjectForm.Activate();

            this.LayoutMdi (MdiLayout.TileHorizontal);

            // Make the project form update itself completely.
            UpdateAll theUpdateAll = new UpdateAll();
            theChildProjectForm.Update(this, theUpdateAll);

            this.UpdateUIControls ();
        }
Ejemplo n.º 8
0
        public MainForm()
        {
            _UserSettings.Load();

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Cursor.Current = Cursors.WaitCursor;

            // Create the singleton array class for all supported Transfer Syntaxes

            Dvtk.Setup.Initialize ();
            _FindForm = new FindForm(this);

            if (_StartWithProjectFile != "")
            {
                _Project.display_message = new Dvt.Project.CallBackMessageDisplay (this.CallBackMessageDisplay);
                _Project.Load(_StartWithProjectFile);
            }
            else if (_StartWithSessionFile != "")
            {
                _Project.display_message = new Dvt.Project.CallBackMessageDisplay (this.CallBackMessageDisplay);
                _Project.New(_StartWithSessionFile.ToLower().Replace (".ses", ".pdvt"));
                _Project.AddSession (_StartWithSessionFile);
            }

            if (_Project.IsProjectConstructed)
            {
                ProjectForm2 theProjectForm = new ProjectForm2(_Project, this);

                theProjectForm.MdiParent = this;

                theProjectForm.Show();
                theProjectForm.Activate();

                // Make the project form update itself completely.
                UpdateAll theUpdateAll = new UpdateAll();
                theProjectForm.Update(this, theUpdateAll);
            }

            this.UpdateUIControls ();

            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 9
0
 public StopExecution(ProjectForm2 theProjectForm)
 {
     _ProjectForm = theProjectForm;
 }