/// <summary> /// Create a new LockButton contained on the specified Lock, linked to the specified button. /// </summary> /// <param name="containingLock">Containing lock.</param> /// <param name="linkedButton">Linked button.</param> /// <param name="on">If set to <c>true</c> on.</param> public LockButton(Lock containingLock, int containingLockIndex, LockButton linkedButton, bool isOn) { ContainingLock = containingLock; ContainingLockIndex = containingLockIndex; LinkedButton = linkedButton; IsOn = isOn; }
/// <summary> /// Initializes a new instance of the <see cref="Models.Lock"/> class with the specified number of buttons. /// </summary> /// <param name="buttonCount">Button count.</param> public Lock(int gridRow, int gridCol, int buttonCount, int currentPosition) { GridRow = gridRow; GridCol = gridCol; Buttons = new LockButton[buttonCount]; for (int buttonIndex=0; buttonIndex<buttonCount; buttonIndex++) { Buttons [buttonIndex] = new LockButton (this, buttonIndex, null, false); } CurrentPosition = currentPosition; }
public LockButtonPushResult(LockButton linkedButton, int linkedButtonContainingLockPriorPosition) { LinkedButton = linkedButton; LinkedButtonContainingLockPriorPosition = linkedButtonContainingLockPriorPosition; }
/// <summary> /// Link this button with the specified button. /// </summary> /// <param name="lockButton">Lock button.</param> public void LinkWithButton(Models.LockButton lockButton) { LinkedButton = lockButton; lockButton.LinkedButton = this; }