Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Updates the DistributionChartLayout with the information from the specified grid.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void UpdateFromDistributionGrid(DistributionGrid grid)
        {
            if (grid == null)
            {
                return;
            }

            Reset();

            // Save the search items.
            for (int i = 1; i < grid.Rows.Count; i++)
            {
                if (i != grid.NewRowIndex)
                {
                    SearchItems.Add(grid[0, i].Value as string);
                }
            }

            // Add the search item column.
            ColumnWidths.Add(grid.Columns[0].Width);

            // Save the environments and column widths.
            for (int i = 1; i < grid.Columns.Count - 1; i++)
            {
                ColumnWidths.Add(grid.Columns[i].Width);
                var query = grid.Columns[i].Tag as SearchQuery;
                if (query != null)
                {
                    SearchQueries.Add(query);
                }
            }

            // Add the new environment column (this is like the column equivalent of the new row).
            ColumnWidths.Add(grid.Columns[grid.Columns.Count - 1].Width);
        }
Beispiel #2
0
 /// ------------------------------------------------------------------------------------
 public static bool ToXLingPaper(PaProject project, string outputFileName,
                                 DistributionGrid distChartGrid, bool openAfterExport)
 {
     return(Process(project, outputFileName, OutputFormat.XHTML, distChartGrid,
                    openAfterExport, Properties.Settings.Default.AppThatOpensXLingPaperXML,
                    new[] { Pipeline.ProcessType.ExportToXLingPaper }));
 }
Beispiel #3
0
 /// ------------------------------------------------------------------------------------
 public static bool ToWordXml(PaProject project, string outputFileName,
                              DistributionGrid distChartGrid, bool openAfterExport)
 {
     return(Process(project, outputFileName, OutputFormat.WordXml, distChartGrid,
                    openAfterExport, Properties.Settings.Default.AppThatOpensWordXml,
                    Pipeline.ProcessType.ExportToWord));
 }
Beispiel #4
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a new DistributionChartLayout object from the specified DistributionGrid.
        /// If the grid is null or empty, then null is returned.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static DistributionChart NewFromDistributionGrid(DistributionGrid grid)
        {
            if (grid == null || (grid.Rows.Count <= 1 && grid.Columns.Count <= 1))
            {
                return(null);
            }

            var layout = new DistributionChart();

            layout.UpdateFromDistributionGrid(grid);
            return(layout);
        }
Beispiel #5
0
        /// ------------------------------------------------------------------------------------
        public SaveDistributionChartDlg(DistributionGrid xyGrid, List <DistributionChart> savedCharts) : this()
        {
            m_xyGrid      = xyGrid;
            m_savedCharts = savedCharts;
            txtName.Text  = (string.IsNullOrEmpty(xyGrid.ChartName) ? xyGrid.DefaultName : xyGrid.ChartName);
            txtName.SelectAll();

            // This will force the user to put something in the name other than
            // spaces or an empty space, even when it was determined to make the
            // default name empty or all spaces. See PA-556.
            if (txtName.Text.Trim() == string.Empty)
            {
                m_dirty = true;
            }
        }
Beispiel #6
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// After delete, It Updates the DistributionChartLayout object from the specified DistributionGrid.
        /// If the grid is null or empty, then null is returned.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static DistributionChart ModifyFromDistributionGrid(DistributionGrid grid)
        {
            if (grid == null || (grid.Rows.Count <= 1 && grid.Columns.Count <= 1))
            {
                return(null);
            }

            var layout = grid.ChartLayout;

            if (layout != null)
            {
                layout.UpdateFromDistributionGrid(grid);
                return(layout);
            }
            return(null);
        }