public Acess ValidTrade(Acess acess = null) { var r = new Acess(); foreach (var item in Fila.ToArray()) { r = FilaControle.Where(x => x.Page == item).LastOrDefault(); if (r.R == 1) { r.SetR(0); } else { if (Table.Where(x => x.Page == r.Page).Select(x => x.Count).FirstOrDefault() >= K) { if (r.M == 1) { r.SetM(0); Fila.Add(Fila.FirstOrDefault()); Fila.RemoveAt(0); } else { return(r); } } } } return(ValidTrade(r)); }
public void AddNewPage(string page) { NewPage(() => { OldValue = Fila.FirstOrDefault(); TradingPostion = Memory.IndexOf(OldValue); Memory[TradingPostion] = NewValue; Fila.Add(NewValue); Fila.RemoveAt(0); }, page); }