Exemplo n.º 1
0
        private void AppendEmulators(List <Emulator> emulators, RegistryKey topLevelKey)
        {
            using (RegistryKey key = GetDeviceFrameworkPaths.OpenDeviceFrameworkKey(topLevelKey, m_runtimeVersionInstalled, RegistryKeys.Emulators))
            {
                if (key != null)
                {
                    string[] subkeyNames = key.GetSubKeyNames();

                    for (int iSubkey = 0; iSubkey < subkeyNames.Length; iSubkey++)
                    {
                        string subkeyName = subkeyNames[iSubkey];

                        using (RegistryKey subkey = key.OpenSubKey(subkeyName))
                        {
                            string path              = subkey.GetValue(RegistryValues.EmulatorPath) as string;
                            string name              = subkey.GetValue(RegistryValues.EmulatorName) as string;
                            string config            = subkey.GetValue(RegistryValues.EmulatorConfig) as string;
                            string options           = subkey.GetValue(RegistryValues.EmulatorOptions) as string;
                            int?   legacyCommandLine = subkey.GetValue(RegistryValues.EmulatorLegacyCommandLine) as int?;
                            bool   fLegacyCommandLine;
                            string persistableName = subkeyName;

                            if (string.IsNullOrEmpty(name))
                            {
                                name = persistableName;
                            }

                            fLegacyCommandLine = legacyCommandLine != null && legacyCommandLine.Value != 0;

                            Emulator emulator = new Emulator();
                            emulator.additionalOptions = options;
                            emulator.application       = path;
                            emulator.config            = config;
                            emulator.legacyCommandLine = fLegacyCommandLine;
                            emulator.name            = name;
                            emulator.persistableName = persistableName;

                            emulators.Add(emulator);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void AppendFolders(List <string> folders, RegistryKey topLevelKey)
        {
            //Add the AssemblyFoldersEx registry entries
            //HKCU settings as well?  Currently just using HKLM
            using (RegistryKey key = GetDeviceFrameworkPaths.OpenDeviceFrameworkKey(topLevelKey, m_runtimeVersionInstalled, RegistryKeys.AssemblyFoldersEx))
            {
                if (key != null)
                {
                    string[] subkeys = key.GetSubKeyNames();

                    for (int iSubKey = 0; iSubKey < subkeys.Length; iSubKey++)
                    {
                        using (RegistryKey subkey = key.OpenSubKey(subkeys[iSubKey]))
                        {
                            AppendFolder(folders, (string)subkey.GetValue(RegistryValues.Default));
                        }
                    }
                }
            }
        }