public void UpdateBalances(Dictionary <Compound, CompoundBalance> balances) { childCache.UnMarkAll(); foreach (var entry in balances) { var compoundControl = childCache.GetChild(entry.Key); var amount = entry.Value.Balance; compoundControl.Amount = amount; compoundControl.ValueColour = amount < 0 ? CompoundAmount.Colour.Red : CompoundAmount.Colour.White; } childCache.DeleteUnmarked(); childCache.ApplyOrder(); }
public override void _Process(float delta) { if (!IsVisibleInTree()) { return; } if (ProcessesToShow == null) { createdProcessControls.Clear(); return; } // Check that all children are up to date createdProcessControls.UnMarkAll(); foreach (var process in ProcessesToShow) { createdProcessControls.GetChild(process); } createdProcessControls.ApplyOrder(); createdProcessControls.DeleteUnmarked(); }