Exemplo n.º 1
0
        /// <summary>
        ///   Creates the computer settings copy.
        /// </summary>
        /// <param name = "computerSettings">The computer settings.</param>
        /// <returns></returns>
        public static ComputerSettingsWithXmlMappings CreateComputerSettingsCopy(ComputerSettings computerSettings)
        {
            // Copy the properties
            ComputerSettingsWithXmlMappings computerSettingsWithXmlMappings = new ComputerSettingsWithXmlMappings();

            computerSettingsWithXmlMappings.ComputerName      = computerSettings.ComputerName;
            computerSettingsWithXmlMappings.IniFileCollection = computerSettings.IniFileCollection;

            // Return result
            return(computerSettingsWithXmlMappings);
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Creates the computer settings object.
        /// </summary>
        /// <param name = "computerName">Name of the computer.</param>
        /// <param name = "iniFiles">The ini files.</param>
        /// <returns>New <see cref = "ComputerSettings" />.</returns>
        public static ComputerSettings CreateComputerSettingsObject(string computerName, IEnumerable <IniFile> iniFiles)
        {
            // Computer settings
            var computerSettings = new ComputerSettings
            {
                ComputerName = computerName
            };

            // Add entries
            foreach (var iniFile in iniFiles)
            {
                computerSettings.IniFileCollection.Add(iniFile);
            }

            computerSettings.SetValue("IsDirty", false);
            return(computerSettings);
        }