示例#1
0
        private void MergeWith(ApplicationConfiguration otherConfiguration)
        {
            // overwrite alias file name
            if (otherConfiguration.DcsBios.AliasFileName != null)
            {
                DcsBios.AliasFileName = otherConfiguration.DcsBios.AliasFileName;
            }

            // just overwrite the config locations
            if (otherConfiguration.DcsBios.ConfigLocations.Any())
            {
                DcsBios.ConfigLocations = otherConfiguration.DcsBios.ConfigLocations;
            }

            // overwrite the bios export settings
            if (otherConfiguration.DcsBios.Export != null)
            {
                DcsBios.Export = otherConfiguration.DcsBios.Export;
            }

            // merge devices
            foreach (var device in otherConfiguration.Osc.Devices)
            {
                Osc.Devices.Add(device);
            }

            // merge common modules
            if (otherConfiguration.CommonModules != null)
            {
                if (CommonModules is null)
                {
                    CommonModules = otherConfiguration.CommonModules;
                }
                else
                {
                    foreach (var module in otherConfiguration.CommonModules)
                    {
                        CommonModules.Add(module);
                    }
                }
            }

            // just overwrite the log level
            LogLevel = otherConfiguration.LogLevel;
        }