Пример #1
0
        public object Clone()
        {
            var backupSettings = new BackupSettings();


            backupSettings.BackupProperties = new List <GeneralProperty>();
            foreach (var property in BackupProperties)
            {
                backupSettings.BackupProperties.Add((GeneralProperty)property.Clone());
            }


            return(backupSettings);
        }
Пример #2
0
        public object Clone()
        {
            var settings = new Settings
            {
                Guid                       = Guid,
                ApplicationPaths           = (ApplicationPaths)ApplicationPaths.Clone(),
                GeneralSettings            = (GeneralSettings)GeneralSettings.Clone(),
                BackupSettings             = (BackupSettings)BackupSettings.Clone(),
                DqfSettings                = (DqfSettings)DqfSettings.Clone(),
                TrackingSettings           = (TrackingSettings)TrackingSettings.Clone(),
                ViewSettings               = (ViewSettings)ViewSettings.Clone(),
                UserProfile                = (UserProfile)UserProfile.Clone(),
                QualityMetricGroupSettings = (QualityMetricGroupSettings)QualityMetricGroupSettings.Clone(),
                QualityMetricGroup         = (QualityMetricGroup)QualityMetricGroup.Clone()
            };



            try
            {
                settings.CompanyProfiles = new List <CompanyProfile>();
                foreach (var cpi in CompanyProfiles)
                {
                    settings.CompanyProfiles.Add((CompanyProfile)cpi.Clone());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Clients: " + ex.Message);
            }


            try
            {
                settings.LanguageRateGroups = new List <LanguageRateGroup>();
                foreach (var priceGroup in LanguageRateGroups)
                {
                    settings.LanguageRateGroups.Add((LanguageRateGroup)priceGroup.Clone());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Rates: " + ex.Message);
            }


            return(settings);
        }