コード例 #1
0
        /// <summary>
        /// Detach the view
        /// </summary>
        public void Detach()
        {
            LedgerViewBox.Detach();
            RowViewBox.Detach();
            ColumnViewBox.Detach();
            ExpressionViewBox.Detach();
            ValueViewBox.Detach();
            FilterViewBox.Detach();
            TimeViewBox.Detach();

            leftButton.Clicked  -= OnInvokeUpdate;
            rightButton.Clicked -= OnInvokeUpdate;
        }
コード例 #2
0
        /// <summary>
        /// Looks through the simulation for resource ledgers and adds
        /// them as options to the ledger box
        /// </summary>
        /// <param name="table">The table model in the simulation</param>
        public void SetLedgers(PivotTable table)
        {
            // Find a CLEMFolder
            CLEMFolder folder = Apsim.Find(table, typeof(CLEMFolder)) as CLEMFolder;

            // Look for ledgers inside the CLEMFolder
            foreach (var child in folder.Children)
            {
                if (child.GetType() != typeof(ReportResourceLedger))
                {
                    continue;
                }

                ReportResourceLedger ledger = child as ReportResourceLedger;
                LedgerViewBox.AddText(ledger.Name);
            }

            // Set the active ledger option
            if (LedgerViewBox.ID < 0)
            {
                LedgerViewBox.ID = 0;
            }
        }