Exemple #1
0
 /// <summary>
 /// Constructor. Fills propertyNames with a copy of current keys to display in the inputfields as placeholder.
 /// See, <see cref="PropertyCell"/>.
 /// </summary>
 public TableSourceAddDeviceProperties(UITableViewControllerAddDeviceProperties owner)
 {
     inputs        = owner.inputFields;
     completeInfo  = owner.pluginInfo;
     propertyNames = new string[completeInfo.RequiredInfo.Keys.Count];
     completeInfo.RequiredInfo.Keys.CopyTo(propertyNames, 0);
 }
        /// <summary>
        /// If a cell is tapped, the properties window is pushed
        /// </summary>
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewControllerAddDeviceProperties addDeviceProperties =
                owner.Storyboard.InstantiateViewController(strings.viewControllerAddDeviceProperties)
                as UITableViewControllerAddDeviceProperties;

            if (addDeviceProperties != null)
            {
                try
                {   // Get the required inputfield that have to be filled in for this device
                    PluginInfo requiredInfo = Globals.ServerToAddDeviceTo.GetPluginInfo(collection, plugins[indexPath.Row]);
                    addDeviceProperties.pluginInfo = requiredInfo;
                    owner.NavigationController.PushViewController(addDeviceProperties, true);
                }
                catch (ServerInteractionException ex)
                {
                    Console.WriteLine("Exception while getting required info");
                    Console.WriteLine(ex);
                    WarningMessage.Display("Exception", "An exception occured on the server trying to get information for available plugins", owner);
                }
            }
        }