Пример #1
0
        public object Clone()
        {
            var viewSettings = new ViewSettings {
                ViewProperties = new List <ViewProperty>()
            };


            foreach (var property in ViewProperties)
            {
                viewSettings.ViewProperties.Add((ViewProperty)property.Clone());
            }

            return(viewSettings);
        }
Пример #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);
        }