ZeroInstall.Publish.Capture.RegUtils.GetSubKeyNames C# (CSharp) Method

GetSubKeyNames() private method

private GetSubKeyNames ( [ root, [ key ) : string[]
root [
key [
return string[]
        public static string[] GetSubKeyNames([NotNull] RegistryKey root, [NotNull] string key)
        {
            #region Sanity checks
            if (root == null) throw new ArgumentNullException(nameof(root));
            if (string.IsNullOrEmpty(key)) throw new ArgumentNullException(nameof(key));
            #endregion

            using (var contextMenuExtendedKey = root.OpenSubKey(key))
                return contextMenuExtendedKey?.GetSubKeyNames() ?? new string[0];
        }
    }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Retrieves data about multiple verbs (executable commands) from the registry.
        /// </summary>
        /// <param name="typeKey">The registry key containing information about the file type / protocol the verbs belong to.</param>
        /// <param name="commandMapper">Provides best-match command-line to <see cref="Command"/> mapping.</param>
        /// <returns>A list of detected <see cref="Verb"/>.</returns>
        private static IEnumerable <Verb> GetVerbs(RegistryKey typeKey, CommandMapper commandMapper)
        {
            #region Sanity checks
            if (typeKey == null)
            {
                throw new ArgumentNullException(nameof(typeKey));
            }
            if (commandMapper == null)
            {
                throw new ArgumentNullException(nameof(commandMapper));
            }
            #endregion

            return(RegUtils.GetSubKeyNames(typeKey, "shell").Select(verbName => GetVerb(typeKey, commandMapper, verbName)).WhereNotNull());
        }
All Usage Examples Of ZeroInstall.Publish.Capture.RegUtils::GetSubKeyNames