Beispiel #1
0
        private void fillSystems()
        {
            if (systemsCollection == null)
            {
                systemsCollection = CoreCollection.Systems.ToList();
                foreach (var appInfo in AppTypeCollection.Apps)
                {
                    if (!systemsCollection.Contains(appInfo.Name))
                    {
                        systemsCollection.Add(appInfo.Name);
                    }
                }
                systemsCollection.Sort();
            }

            listBoxSystem.BeginUpdate();
            listBoxSystem.Items.Clear();
            listBoxSystem.Items.Add(Resources.Unassigned);
            var collection = showAllSystemsCheckBox.Checked || firstSelected == null ? (IEnumerable <string>)systemsCollection : CoreCollection.GetSystemsFromExtension(firstSelected.SubItems[1].Text.ToLower()).ToArray();

            if (collection.Any())
            {
                foreach (var system in collection.OrderBy(s => s))
                {
                    listBoxSystem.Items.Add(system);
                }
            }
            else
            {
                var appInfo = AppTypeCollection.GetAppByExtension(firstSelected.SubItems[1].Text.ToLower());
                if (!appInfo.Unknown)
                {
                    listBoxSystem.Items.Add(appInfo.Name);
                }
            }
            listBoxSystem.Enabled = true;
            listBoxSystem.EndUpdate();
        }
Beispiel #2
0
        private void fillSystems()
        {
            listBoxSystem.BeginUpdate();
            listBoxSystem.Items.Clear();
            listBoxSystem.Items.Add(Resources.Unassigned);
            var collection = showAllSystemsCheckBox.Checked || firstSelected == null ? CoreCollection.Systems : CoreCollection.GetSystemsFromExtension(firstSelected.SubItems[1].Text.ToLower()).ToArray();

            foreach (var system in collection)
            {
                listBoxSystem.Items.Add(system);
            }
            listBoxSystem.Enabled = true;
            listBoxSystem.EndUpdate();
        }