/// <summary> /// Displays a selection form to the user. /// </summary> /// <remarks> /// The items, previews, and descriptions are repectively ordered. In other words, /// the i-th item in <paramref name="p_strItems"/> uses the i-th preview in /// <paramref name="p_imgPreviews"/> and the i-th description in <paramref name="p_strDescriptions"/>. /// /// Similarly, the idices return as results correspond to the indices of the items in /// <paramref name="p_strItems"/>. /// </remarks> /// <param name="p_strItems">The items from which to select.</param> /// <param name="p_imgPreviews">The preview images for the items.</param> /// <param name="p_strDescriptions">The descriptions of the items.</param> /// <param name="p_strTitle">The title of the selection form.</param> /// <param name="p_booSelectMany">Whether more than one item can be selected.</param> /// <returns>The indices of the selected items.</returns> public int[] Select(string[] p_strItems, Image[] p_imgPreviews, string[] p_strDescriptions, string p_strTitle, bool p_booSelectMany) { List<Nexus.Client.ModManagement.Scripting.SelectOption> lstOptions = new List<Nexus.Client.ModManagement.Scripting.SelectOption>(); for (Int32 i = 0; i < p_strItems.Length; i++) { string strDescription = p_strDescriptions.IsNullOrEmpty() ? null : p_strDescriptions[i]; Image imgPreview = p_imgPreviews.IsNullOrEmpty() ? null : p_imgPreviews[i]; lstOptions.Add(new Nexus.Client.ModManagement.Scripting.SelectOption(p_strItems[i], false, strDescription, imgPreview)); } string[] strSelections = UIManager.Select(lstOptions, p_strTitle, p_booSelectMany); List<Int32> lstSelectionIndices = new List<Int32>(); foreach (string strSelection in strSelections) lstSelectionIndices.Add(Array.IndexOf(p_strItems, strSelection)); return lstSelectionIndices.ToArray(); }