Exemplo n.º 1
0
        private void fillGames()
        {
            listViewGames.Items.Clear();
            foreach (var game in Games)
            {
                var core     = CoreCollection.GetCore(game.Metadata.Core);
                var filename = Path.GetFileName(game.GameFilePath);

                if (string.IsNullOrEmpty(filename) && game.Desktop.Args.Length > 0)
                {
                    filename = Path.GetFileName(game.Desktop.Args[0]);
                }

                if (!string.IsNullOrEmpty(filename))
                {
                    if (filename.EndsWith(".7z"))
                    {
                        filename = filename.Substring(0, filename.Length - 3);
                    }
                    if (filename.EndsWith(".zip"))
                    {
                        filename = filename.Substring(0, filename.Length - 4);
                    }
                    var item = new ListViewItem(new string[] { game.Name, Path.GetExtension(filename), game.Metadata.System, core == null ? string.Empty : core.Name });
                    item.Tag = game;
                    listViewGames.Items.Add(item);
                }
            }
        }
Exemplo n.º 2
0
 private void fillGames()
 {
     listViewGames.Items.Clear();
     foreach (var game in Games)
     {
         var core     = CoreCollection.GetCore(game.Metadata.Core);
         var filename = Path.GetFileName(game.GameFilePath) ?? string.Empty;
         if (game.IsOriginalGame || !string.IsNullOrEmpty(filename))
         {
             if (filename.EndsWith(".7z"))
             {
                 filename = filename.Substring(0, filename.Length - 3);
             }
             if (filename.EndsWith(".zip"))
             {
                 filename = filename.Substring(0, filename.Length - 4);
             }
             var item = new ListViewItem(new string[] {
                 game.Name,
                 Path.GetFileNameWithoutExtension(filename),
                 Path.GetExtension(filename),
                 game.Metadata.System,
                 Resources.DefaultNoChange
             });
             item.Tag = game;
             listViewGames.Items.Add(item);
         }
     }
     coverColumnHeader.Width = -2;
 }
Exemplo n.º 3
0
 public SelectCoreDialog()
 {
     InitializeComponent();
     CoreCollection.HmodInfo = Hmod.Hmod.GetMods(false, new string[] { }).ToArray();
     CoreCollection.Load();
     Icon         = Resources.icon;
     Modified     = false;
     DialogResult = DialogResult.Abort;
 }
Exemplo n.º 4
0
        private void fillCores(string system)
        {
            listBoxCore.BeginUpdate();
            listBoxCore.Items.Clear();
            listBoxCore.Items.Add(Resources.Unassigned);
            var collection = string.IsNullOrEmpty(system) ? CoreCollection.Cores : CoreCollection.GetCoresFromSystem(system);

            if (collection != null)
            {
                foreach (var core in collection.OrderBy(c => c.Name))
                {
                    listBoxCore.Items.Add(core);
                }
            }
            listBoxCore.Enabled = true;
            listBoxCore.EndUpdate();
        }
Exemplo n.º 5
0
        private void fillCores(string system)
        {
            listBoxCore.BeginUpdate();
            listBoxCore.Items.Clear();
            var collection = string.IsNullOrEmpty(system) ? CoreCollection.Cores : CoreCollection.GetCoresFromSystem(system);

            //var collection = firstSelected == null ? CoreCollection.Cores : CoreCollection.GetCoresFromExtension(firstSelected.SubItems[1].Text.ToLower()).ToArray();
            if (collection != null)
            {
                foreach (var core in collection)
                {
                    listBoxCore.Items.Add(core);
                }
            }
            listBoxCore.Enabled = true;
            listBoxCore.EndUpdate();
        }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
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();
        }