Пример #1
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (!gGame.CanSerialize())
            {
                return;
            }

            // Settings tab
            foreach (ListViewItem item in SettingsList.Items)
            {
                string FileName = item.Text;
                if (gGame.Settings.ContainsKey(FileName))
                {
                    gGame.Settings[FileName].IsEnabled = item.Checked;
                }
            }

            // Power Profiles tab
            gGame.PowerProfiles.Clear();
            foreach (ListViewItem item in ProfilesList.Items)
            {
                PowerProfile profile = MainForm.ProfileDB[(Guid)item.Tag];
                if (item.Checked)
                {
                    gGame.PowerProfiles.Add(profile.ProfileGuid, profile);
                }
            }

            gGame.SanityCheck();
            gForm.InsertOrUpdateGameItem(gGame, false);
            this.Close();
        }
Пример #2
0
        public static List <DockerGame> SearchUniversal()
        {
            List <DockerGame> listofGames = new List <DockerGame>();

            // HKEY_CURRENT_USER\System\GameConfigStore\Children
            string      regkey = "System\\GameConfigStore\\Children";
            RegistryKey key    = Registry.LocalMachine.OpenSubKey(regkey);

            // HKEY_CURRENT_USER\System\GameConfigStore\Children
            regkey = "System\\GameConfigStore\\Children";
            key    = Registry.CurrentUser.OpenSubKey(regkey);

            foreach (string ksubKey in key.GetSubKeyNames())
            {
                using (RegistryKey subKey = key.OpenSubKey(ksubKey))
                {
                    Dictionary <string, string> subKeys = new Dictionary <string, string>();

                    foreach (string subkeyname in subKey.GetValueNames())
                    {
                        subKeys.Add(subkeyname, subKey.GetValue(subkeyname).ToString());
                    }

                    if (subKeys.ContainsKey("MatchedExeFullPath"))
                    {
                        string filePath = subKeys["MatchedExeFullPath"];

                        if (File.Exists(filePath))
                        {
                            DockerGame thisGame = new DockerGame(filePath);
                            thisGame.Platform = PlatformCode.Steam;
                            thisGame.SanityCheck();
                            listofGames.Add(thisGame);
                        }
                    }
                }
            }

            return(listofGames);
        }
Пример #3
0
        public static List <DockerGame> SearchBattleNet()
        {
            List <DockerGame> listofGames = new List <DockerGame>();

            // HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
            string      regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
            RegistryKey key    = Registry.LocalMachine.OpenSubKey(regkey);

            foreach (string ksubKey in key.GetSubKeyNames())
            {
                using (RegistryKey subKey = key.OpenSubKey(ksubKey))
                {
                    Dictionary <string, string> subKeys = new Dictionary <string, string>();

                    foreach (string subkeyname in subKey.GetValueNames())
                    {
                        subKeys.Add(subkeyname, subKey.GetValue(subkeyname).ToString());
                    }

                    if (subKeys.ContainsKey("UninstallString"))
                    {
                        string UninstallString = subKeys["UninstallString"];

                        if (UninstallString.Contains("Battle.net"))
                        {
                            string filePath = subKeys["DisplayIcon"];
                            if (File.Exists(filePath))
                            {
                                DockerGame thisGame = new DockerGame(filePath);
                                thisGame.Platform = PlatformCode.BattleNet;
                                thisGame.SanityCheck();
                                listofGames.Add(thisGame);
                            }
                        }
                    }
                }
            }

            return(listofGames);
        }