protected MLayout FindChildrenLayoutWithSameControls(MLayout who) { foreach (MWidget w in Children) { MLayout ml = w as MLayout; if (ml != null && ml.CompareKeys(who) && !ml.IsLocked) { return(ml); } ml = w.FindChildrenLayoutWithSameControls(who); if (ml != null && !ml.IsLocked) { return(ml); } } return(null); }
bool Move(ConsoleKeyInfo keyInfo) { MLayout childLay = this.FindChildrenLayoutWithSameControls(this); if (childLay != null) { return(false); } if (keyInfo.Key == keyIncrease) { AddIndex(1); return(true); } if (keyInfo.Key == keyDecrease) { AddIndex(-1); return(true); } return(false); }
public bool CompareKeys(MLayout another) { return((keyDecrease == another.keyDecrease) && (keyIncrease == another.keyIncrease)); }