using FLY.Weight.Client; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FLY.Weight.UI.Client { public class WeightSystemServiceClientWithColor : WeightSystemServiceClient { public WeightSystemServiceClientWithColor(UInt32 serviceId, string connName) : base(serviceId, connName) { //------------------------------------------------------- //添加颜色 this.ResetItemsEvent += WeightSystemServiceClientWithColor_ResetItemsEvent; WeightSystemServiceClientWithColor_ResetItemsEvent(); } private void WeightSystemServiceClientWithColor_ResetItemsEvent() { foreach (FLY.Weight.Common.WeighterC w in Items) { w.Color = WeighterColorDB.GetSelf(w.Number); for (int i = 0; i < w.Ingredients.Count(); i++) { w.Ingredients[i].Color = WeighterColorDB.GetItem(w.Number, i); } } } } }