public void RefreshSeries() { foreach (Control C in Panel.Controls) { if (C is Controllers.BaseView) { Controllers.BaseView View = (Controllers.BaseView)C; View.OnRefresh(); } } }
public override void OnSave() { base.OnSave(); foreach (Control C in Panel.Controls) { if (C is Controllers.BaseView) { Controllers.BaseView View = (Controllers.BaseView)C; View.OnSave(); ApsimFile.Component Comp = Controller.ApsimData.Find(View.NodePath); if (Comp != null) { Comp.Contents = View.GetData(); } } } }
private void PositionAndRefreshGraphs() { this.Resize -= OnResize; int NumGraphs = Panel.Controls.Count; if (NumGraphs > 0) { int NumRows; if (NumGraphs == 1) { NumRows = 1; } else { NumRows = (int)Math.Sqrt(NumGraphs - 1) + 1; } int NumCols = (int)Math.Ceiling((double)NumGraphs / NumRows); int Width = Panel.Size.Width / NumCols; int Height = Panel.Size.Height / NumRows - 1; int GraphNumber = 0; int Col = 0; int Row = 0; foreach (Control C in Panel.Controls) { if (C is Controllers.BaseView) { C.Location = new Point(Col * Width, Row * Height); C.Width = Width; C.Height = Height; GraphNumber++; Col++; if (Col >= NumCols) { Col = 0; Row++; } Controllers.BaseView Graph = (Controllers.BaseView)C; Graph.OnRefresh(); } } } this.Resize += OnResize; }