예제 #1
0
        private void ShowConsumersToolStripMenuItemClick(object sender, EventArgs e)
        {
            CursorStateHelper csh = new CursorStateHelper(this, Cursors.WaitCursor);

            try
            {
                MemoryStream        ms     = new MemoryStream();
                StreamWriter        sw     = new StreamWriter(ms);
                CellConsumersReport report = new CellConsumersReport(MatrixModel);
                report.WriteReport(sw);

                HtmlViewer viewer = new HtmlViewer(ms);
                viewer.Show();

                Invalidate();
            }
            catch (Exception ex)
            {
                ErrorDialog.Show(ex.ToString());
            }
            finally
            {
                csh.Reset();
            }
        }
예제 #2
0
        public void DoProjectOpen(FileInfo dsmFile)
        {
            if (ConfirmModelSaved())
            {
                IDsmModel newModel = new DsmModel(null, null);
                ICommand  cmd      = new CommandOpen(newModel, dsmFile);

                CursorStateHelper csh = new CursorStateHelper(this, Cursors.WaitCursor);

                Refresh();

                ModelessMessageBox msg = new ModelessMessageBox("Loading project file");
                try
                {
                    cmd.Execute(msg.UpdateProgress);

                    if (cmd.Completed)
                    {
                        SetModel(newModel);
                        _matrixControl.Size = new Size(panel1.ClientSize.Width, panel1.ClientSize.Height);
                    }
                }
                catch (DsmException dsmEx)
                {
                    MessageBox.Show("Unable to load DSM fom file for the following reason: " +
                                    Environment.NewLine + Environment.NewLine + dsmEx,
                                    "Dependency Structure Matrix",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                catch (Exception ex)
                {
                    ErrorDialog.Show(ex.ToString());
                }
                finally
                {
                    msg.Dispose();
                    csh.Reset();
                }

                if ((newModel != null) && (newModel.ModelFilename != null))
                {
                    this.Text = "DSM Viewer - " + newModel.ModelFilename;
                }
            }
        }
예제 #3
0
        private void ParitionToolStripMenuItemClick(object sender, EventArgs e)
        {
            ICommand          cmd = new CommandPartition(MatrixModel);
            CursorStateHelper csh = new CursorStateHelper(this, Cursors.WaitCursor);

            try
            {
                cmd.Execute(null);

                Invalidate();
            }
            catch (Exception ex)
            {
                ErrorDialog.Show(ex.ToString());
            }
            finally
            {
                csh.Reset();
            }
        }
예제 #4
0
        private void DoProjectSave()
        {
            ICommand cmd = new CommandSave(_model);

            CursorStateHelper csh = new CursorStateHelper(this, Cursors.WaitCursor);

            Refresh();

            try
            {
                cmd.Execute(null);
            }
            catch (Exception ex)
            {
                ErrorDialog.Show(ex.ToString());
            }
            finally
            {
                csh.Reset();
            }
        }
예제 #5
0
        private void DoPartitioning()
        {
            ICommand          cmd = new CommandPartition(_model);
            CursorStateHelper csh = new CursorStateHelper(this, Cursors.WaitCursor);

            Refresh();

            try
            {
                cmd.Execute(null);

                _matrixControl.Invalidate();
            }
            catch (Exception ex)
            {
                ErrorDialog.Show(ex.ToString());
            }
            finally
            {
                csh.Reset();
            }
        }