Import() private method

Imports a registry XML file.
private Import ( string path, string>.Dictionary properties = null ) : void
path string Path to the registry XML file to import.
properties string>.Dictionary Optional properties to replace during import.
return void
Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="MockRegistry"/> and loads either the default or specified registry data file and properties.
        /// </summary>
        /// <param name="path">Optional path to the registry data file. If null, "Regstry.xml" is used from the <see cref="TestContext.DesloymentDirectory"/>.</param>
        /// <param name="properties">Additional properties to populate in the specified registry data file.</param>
        /// <returns>A new <see cref="MockRegistry"/> that must be disposed.</returns>
        internal MockRegistry OverrideRegistry(string path = null, Dictionary <string, string> properties = null)
        {
            if (string.IsNullOrEmpty(path))
            {
                path = Path.Combine(this.TestContext.DeploymentDirectory, "Registry.xml");
            }

            if (null == properties)
            {
                properties = this.DefaultRegistryProperties;
            }

            var reg = new MockRegistry();

            reg.Import(path, properties);

            return(reg);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new <see cref="MockRegistry"/> and loads either the default or specified registry data file and properties.
        /// </summary>
        /// <param name="path">Optional path to the registry data file. If null, "Regstry.xml" is used from the <see cref="TestContext.DesloymentDirectory"/>.</param>
        /// <param name="properties">Additional properties to populate in the specified registry data file.</param>
        /// <returns>A new <see cref="MockRegistry"/> that must be disposed.</returns>
        internal MockRegistry OverrideRegistry(string path = null, Dictionary<string, string> properties = null)
        {
            if (string.IsNullOrEmpty(path))
            {
                path = Path.Combine(this.TestContext.DeploymentDirectory, "Registry.xml");
            }

            if (null == properties)
            {
                properties = this.DefaultRegistryProperties;
            }

            var reg = new MockRegistry();
            reg.Import(path, properties);

            return reg;
        }