// Provide the zone to `AddRoomViewController`. public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == AddRoomsSegue) { var addViewController = (AddRoomViewController)segue.IntendedDestinationViewController (); addViewController.HomeZone = HomeZone; } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier == AddServicesSegue) { var addServicesVC = (AddServicesViewController)segue.IntendedDestinationViewController(); addServicesVC.ServiceGroup = ServiceGroup; } }
// Provide the zone to `AddRoomViewController`. public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier == AddRoomsSegue) { var addViewController = (AddRoomViewController)segue.IntendedDestinationViewController(); addViewController.HomeZone = HomeZone; } }
// Sets the accessory and home of the modifyAccessoryViewController that will be presented. public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); var indexPath = TableView.IndexPathForCell((UITableViewCell)sender); if (segue.Identifier == ModifyAccessorySegue) { var modifyViewController = (ModifyAccessoryViewController)segue.IntendedDestinationViewController(); modifyViewController.Accessory = Room.Accessories [indexPath.Row]; } }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { if (segue.Identifier == ShowServicesSegue) { var senderCell = (UITableViewCell)sender; var servicesVC = (ServicesViewController)segue.IntendedDestinationViewController (); var cellIndex = TableView.IndexPathForCell (senderCell).Row; servicesVC.AllowsAllWrites = true; servicesVC.OnlyShowsControlServices = true; servicesVC.Accessory = accessories [cellIndex]; servicesVC.CellDelegate = TriggerCreator; } }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == SelectCharacteristicSegue) { var destinationVC = segue.IntendedDestinationViewController () as CharacteristicSelectionViewController; if (destinationVC != null) { destinationVC.EventTrigger = EventTrigger; destinationVC.TriggerCreator = CharacteristicTriggerCreator; } } }
// Sets the accessory, home, and delegate of a ModifyAccessoryViewController. public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); var accessorySender = sender as HMAccessory; if (accessorySender != null && segue.Identifier == AddAccessorySegue) { var modifyViewController = (ModifyAccessoryViewController)segue.IntendedDestinationViewController(); modifyViewController.Accessory = accessorySender; modifyViewController.Delegate = this; } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier == SelectCharacteristicSegue) { var destinationVC = segue.IntendedDestinationViewController() as CharacteristicSelectionViewController; if (destinationVC != null) { destinationVC.EventTrigger = EventTrigger; destinationVC.TriggerCreator = CharacteristicTriggerCreator; } } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { if (segue.Identifier == ShowServicesSegue) { var senderCell = (UITableViewCell)sender; var servicesVC = (ServicesViewController)segue.IntendedDestinationViewController(); var cellIndex = TableView.IndexPathForCell(senderCell).Row; servicesVC.AllowsAllWrites = true; servicesVC.OnlyShowsControlServices = true; servicesVC.Accessory = accessories [cellIndex]; servicesVC.CellDelegate = TriggerCreator; } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier == showServiceSegue) { var servicesViewController = (ServicesViewController)segue.IntendedDestinationViewController(); servicesViewController.OnlyShowsControlServices = true; servicesViewController.CellDelegate = ActionSetCreator; var index = TableView.IndexPathForCell((UITableViewCell)sender).Row; servicesViewController.Accessory = displayedAccessories [index]; } }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == ShowServiceSegue) { var indexPath = TableView.IndexPathForCell ((UITableViewCell)sender); if (indexPath != null) { var characteristicsViewController = (CharacteristicsViewController)segue.IntendedDestinationViewController (); var selectedService = tableViewDataSource.ServiceForIndexPath (indexPath); if (selectedService != null) characteristicsViewController.Service = selectedService; characteristicsViewController.CellDelegate = cellController; } } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier == selectLocationSegue) { var destinationVC = segue.IntendedDestinationViewController() as MapViewController; if (destinationVC == null) { return; } // Give the map the previous target region (if exists). destinationVC.TargetRegion = LocationTriggerCreator.TargetRegion; destinationVC.Delegate = LocationTriggerCreator; } }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); var vc = segue.IntendedDestinationViewController (); var timeVC = vc as TimeConditionViewController; if (timeVC != null) { timeVC.TriggerCreator = EventTriggerCreator; return; } var characteristicEventVC = vc as CharacteristicSelectionViewController; if (characteristicEventVC != null) { characteristicEventVC.TriggerCreator = (EventTriggerCreator)TriggerCreator; return; } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); var vc = segue.IntendedDestinationViewController(); var timeVC = vc as TimeConditionViewController; if (timeVC != null) { timeVC.TriggerCreator = EventTriggerCreator; return; } var characteristicEventVC = vc as CharacteristicSelectionViewController; if (characteristicEventVC != null) { characteristicEventVC.TriggerCreator = (EventTriggerCreator)TriggerCreator; return; } }
// Passes the `CharacteristicsViewController` the service from the cell and configures the view controller. public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier != ShowServiceSegue) { return; } var indexPath = TableView.IndexPathForCell((UITableViewCell)sender); if (indexPath == null) { return; } var selectedService = displayedServices [indexPath.Row]; var characteristicsViewController = (CharacteristicsViewController)segue.IntendedDestinationViewController(); characteristicsViewController.ShowsFavorites = ShowsFavorites; characteristicsViewController.AllowsAllWrites = AllowsAllWrites; characteristicsViewController.Service = selectedService; characteristicsViewController.CellDelegate = CellDelegate; }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == showServiceSegue) { var servicesViewController = (ServicesViewController)segue.IntendedDestinationViewController (); servicesViewController.OnlyShowsControlServices = true; servicesViewController.CellDelegate = ActionSetCreator; var index = TableView.IndexPathForCell ((UITableViewCell)sender).Row; servicesViewController.Accessory = displayedAccessories [index]; } }
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue(segue, sender); if (segue.Identifier == ShowServiceSegue) { var indexPath = TableView.IndexPathForCell((UITableViewCell)sender); if (indexPath != null) { var characteristicsViewController = (CharacteristicsViewController)segue.IntendedDestinationViewController(); var selectedService = tableViewDataSource.ServiceForIndexPath(indexPath); if (selectedService != null) { characteristicsViewController.Service = selectedService; } characteristicsViewController.CellDelegate = cellController; } } }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == AddServicesSegue) { var addServicesVC = (AddServicesViewController)segue.IntendedDestinationViewController (); addServicesVC.ServiceGroup = ServiceGroup; } }
// Determines the destination of the segue and passes the correct // HomeKit object onto the next view controller. public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { var cell = sender as UITableViewCell; if (cell == null) return; var indexPath = TableView.IndexPathForCell (cell); if (indexPath == null) return; var destination = segue.IntendedDestinationViewController (); var row = indexPath.Row; switch (segue.Identifier) { case ShowRoomSegue: var roomVC = (RoomViewController)destination; roomVC.Room = ObjectCollection.Rooms [row]; break; case ShowZoneSegue: var zoneViewController = (ZoneViewController)destination; zoneViewController.HomeZone = ObjectCollection.Zones [row]; break; case ShowActionSetSegue: var actionSetVC = (ActionSetViewController)destination; actionSetVC.ActionSet = ObjectCollection.ActionSets [row]; break; case ShowServiceGroupSegue: var serviceGroupVC = (ServiceGroupViewController)destination; serviceGroupVC.ServiceGroup = ObjectCollection.ServiceGroups [row]; break; case ShowAccessorySegue: var detailVC = (ServicesViewController)destination; // The services view controller is generic, we need to provide // `showsFavorites` to display the stars next to characteristics. detailVC.Accessory = ObjectCollection.Accessories [row]; detailVC.ShowsFavorites = true; detailVC.CellDelegate = new AccessoryUpdateController (); break; case ModifyAccessorySegue: var addAccessoryVC = (ModifyAccessoryViewController)destination; addAccessoryVC.Accessory = ObjectCollection.Accessories [row]; break; case ShowTimerTriggerSegue: var triggerVC = (TimerTriggerViewController)destination; triggerVC.Trigger = ObjectCollection.Triggers [row]; break; case ShowLocationTriggerSegue: var locationTriggerVC = (LocationTriggerViewController)destination; locationTriggerVC.Trigger = ObjectCollection.Triggers [row]; break; case ShowCharacteristicTriggerSegue: var characteristicTriggerVC = (CharacteristicTriggerViewController)destination; characteristicTriggerVC.Trigger = ObjectCollection.Triggers [row]; break; default: throw new InvalidOperationException (string.Format ("Received unknown segue identifier: {0}", segue.Identifier)); } }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == selectLocationSegue) { var destinationVC = segue.IntendedDestinationViewController () as MapViewController; if (destinationVC == null) return; // Give the map the previous target region (if exists). destinationVC.TargetRegion = LocationTriggerCreator.TargetRegion; destinationVC.Delegate = LocationTriggerCreator; } }
// Determines the destination of the segue and passes the correct // HomeKit object onto the next view controller. public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { var cell = sender as UITableViewCell; if (cell == null) { return; } var indexPath = TableView.IndexPathForCell(cell); if (indexPath == null) { return; } var destination = segue.IntendedDestinationViewController(); var row = indexPath.Row; switch (segue.Identifier) { case ShowRoomSegue: var roomVC = (RoomViewController)destination; roomVC.Room = ObjectCollection.Rooms [row]; break; case ShowZoneSegue: var zoneViewController = (ZoneViewController)destination; zoneViewController.HomeZone = ObjectCollection.Zones [row]; break; case ShowActionSetSegue: var actionSetVC = (ActionSetViewController)destination; actionSetVC.ActionSet = ObjectCollection.ActionSets [row]; break; case ShowServiceGroupSegue: var serviceGroupVC = (ServiceGroupViewController)destination; serviceGroupVC.ServiceGroup = ObjectCollection.ServiceGroups [row]; break; case ShowAccessorySegue: var detailVC = (ServicesViewController)destination; // The services view controller is generic, we need to provide // `showsFavorites` to display the stars next to characteristics. detailVC.Accessory = ObjectCollection.Accessories [row]; detailVC.ShowsFavorites = true; detailVC.CellDelegate = new AccessoryUpdateController(); break; case ModifyAccessorySegue: var addAccessoryVC = (ModifyAccessoryViewController)destination; addAccessoryVC.Accessory = ObjectCollection.Accessories [row]; break; case ShowTimerTriggerSegue: var triggerVC = (TimerTriggerViewController)destination; triggerVC.Trigger = ObjectCollection.Triggers [row]; break; case ShowLocationTriggerSegue: var locationTriggerVC = (LocationTriggerViewController)destination; locationTriggerVC.Trigger = ObjectCollection.Triggers [row]; break; case ShowCharacteristicTriggerSegue: var characteristicTriggerVC = (CharacteristicTriggerViewController)destination; characteristicTriggerVC.Trigger = ObjectCollection.Triggers [row]; break; default: throw new InvalidOperationException(string.Format("Received unknown segue identifier: {0}", segue.Identifier)); } }
// Sets the accessory and home of the modifyAccessoryViewController that will be presented. public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); var indexPath = TableView.IndexPathForCell ((UITableViewCell)sender); if (segue.Identifier == ModifyAccessorySegue) { var modifyViewController = (ModifyAccessoryViewController)segue.IntendedDestinationViewController (); modifyViewController.Accessory = Room.Accessories [indexPath.Row]; } }
// Passes the `CharacteristicsViewController` the service from the cell and configures the view controller. public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier != ShowServiceSegue) return; var indexPath = TableView.IndexPathForCell ((UITableViewCell)sender); if (indexPath == null) return; var selectedService = displayedServices [indexPath.Row]; var characteristicsViewController = (CharacteristicsViewController)segue.IntendedDestinationViewController (); characteristicsViewController.ShowsFavorites = ShowsFavorites; characteristicsViewController.AllowsAllWrites = AllowsAllWrites; characteristicsViewController.Service = selectedService; characteristicsViewController.CellDelegate = CellDelegate; }