public static void ChangeEnterButtonDevice(GKDoor door, GKDevice device) { RemoveDependenctElement(door, door.EnterButtonUID); door.EnterButtonUID = device != null ? device.UID : Guid.Empty; if (door.EnterButton != null) { door.EnterButton.Door = null; } door.EnterButton = device; if (door.EnterButton != null) { door.EnterButton.Door = door; door.AddDependentElement(door.EnterButton); } door.OnChanged(); }
public static void ChangeLockControlDeviceExit(GKDoor door, GKDevice device) { RemoveDependenctElement(door, door.LockControlDeviceExitUID); door.LockControlDeviceExitUID = device != null ? device.UID : Guid.Empty; if (door.LockControlDeviceExit != null) { door.LockControlDeviceExit.Door = null; } door.LockControlDeviceExit = device; if (door.LockControlDeviceExit != null) { door.LockControlDeviceExit.Door = door; door.AddDependentElement(door.LockControlDeviceExit); } door.OnChanged(); }