コード例 #1
0
            internal virtual void SetUpMultiChoiceCallback(bool[] checkedItems, IDialogInterfaceOnMultiChoiceClickListener listener)
            {
                int[] selectedIndicesArr = null;
                /* Convert old style array of booleans-per-index to new list of indices */
                if (checkedItems != null)
                {
                    List <int> selectedIndices = new List <int>();
                    for (int i = 0; i < checkedItems.Length; i++)
                    {
                        if (checkedItems[i])
                        {
                            selectedIndices.Add(i);
                        }
                    }
                    selectedIndicesArr = selectedIndices.ToArray();
                }

                builder.SetItemsCallbackMultiChoice(selectedIndicesArr, new ListCallbackMultiChoiceAnonymousInnerClassHelper(this, checkedItems, listener));
            }
コード例 #2
0
 public ListCallbackMultiChoiceAnonymousInnerClassHelper(Builder builder, bool[] checkedItems, IDialogInterfaceOnMultiChoiceClickListener listener)
 {
     this.builder      = builder;
     this.checkedItems = checkedItems;
     this.listener     = listener;
 }
コード例 #3
0
 /// <summary>
 /// Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
 /// </summary>
 /// <param name="items">        the text of the items to be displayed in the list. </param>
 /// <param name="checkedItems"> specifies which items are checked. It should be null in which case no items are checked. If non null it must be exactly the same length as the array of items. </param>
 /// <param name="listener">     notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.		 * @return </param>
 /// <returns> This </returns>
 public virtual Builder SetMultiChoiceItems(string[] items, bool[] checkedItems, IDialogInterfaceOnMultiChoiceClickListener listener)
 {
     builder.SetItems(items);
     SetUpMultiChoiceCallback(checkedItems, listener);
     return(this);
 }