/// ------------------------------------------------------------------------------------ /// <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); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Returns a deep copy of the layout. /// </summary> /// ------------------------------------------------------------------------------------ public DistributionChart Clone() { var clone = new DistributionChart(); clone._name = _name; foreach (var srchItem in SearchItems) { clone.SearchItems.Add(srchItem); } foreach (var query in SearchQueries) { clone.SearchQueries.Add(query.Clone()); } foreach (int width in ColumnWidths) { clone.ColumnWidths.Add(width); } return(clone); }