// Generates a characteristic cell based on the type of characteristic located at the specified index path.
        UITableViewCell GetCellForCharacteristicCell(UITableView tableView, NSIndexPath indexPath)
        {
            HMCharacteristic characteristic = Service.Characteristics [indexPath.Row];

            var reuseIdentifier = characteristicCell;

            if ((characteristic.IsReadOnly() || characteristic.IsWriteOnly()) && !allowsAllWrites)
            {
                reuseIdentifier = characteristicCell;
            }
            else if (characteristic.IsBoolean())
            {
                reuseIdentifier = switchCharacteristicCell;
            }
            else if (characteristic.HasPredeterminedValueDescriptions())
            {
                reuseIdentifier = segmentedControlCharacteristicCell;
            }
            else if (characteristic.IsNumeric())
            {
                reuseIdentifier = sliderCharacteristicCell;
            }
            else if (characteristic.IsTextWritable())
            {
                reuseIdentifier = textCharacteristicCell;
            }

            var cell = (CharacteristicCell)tableView.DequeueReusableCell(reuseIdentifier, indexPath);

            cell.ShowsFavorites = showsFavorites;
            cell.Delegate       = Delegate;
            cell.Characteristic = characteristic;

            return(cell);
        }
        public static string LocalizedCharacteristicType(this HMCharacteristic self)
        {
            var type = self.LocalizedDescription;

            string description = null;

            if (self.IsReadOnly())
            {
                description = "Read Only";
            }
            else if (self.IsWriteOnly())
            {
                description = "Write Only";
            }

            if (description != null)
            {
                type = string.Format("{0} {1}", type, description);
            }

            return(type);
        }