Beispiel #1
0
        public static ListboxItem[] ToArray(Dictionary <string, string> items)
        {
            ListboxItem[] itemArray = new ListboxItem[items.Count];

            int i = 0;

            foreach (var s in items.Keys)
            {
                ListboxItem itm = new ListboxItem(s, items[s]);

                itemArray[i] = itm;

                i++;
            }

            return(itemArray);
        }
Beispiel #2
0
        void PopulateDropdowns()
        {
            if (Global.Formats.Count > 0)
            {
                VolumeFormat.Items.AddRange(ListboxItem.ToArray(Global.Formats));
            }

            if (Global.Genres.Count > 0)
            {
                Genres.Items.AddRange(ListboxItem.ToArray(Global.Genres));
            }

            if (Global.Locations.Count > 0)
            {
                VolumeLocation.Items.AddRange(ListboxItem.ToArray(Global.Locations));
            }

            if (Global.Statuses.Count > 0)
            {
                VolumeStatus.Items.AddRange(ListboxItem.ToArray(Global.Statuses));
            }
        }