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); }
public Settings() { Guid = string.Empty; ApplicationPaths = new ApplicationPaths(); SettingsInitialization.Initialize_GeneralSettings(this); SettingsInitialization.Initialize_BackupSettings(this); SettingsInitialization.Initialize_TrackerSettings(this); SettingsInitialization.Initialize_ViewSettings(this); DqfSettings = new DqfSettings(); LanguageRateGroups = new List <LanguageRateGroup>(); UserProfile = new UserProfile(); CompanyProfiles = new List <CompanyProfile>(); QualityMetricGroupSettings = new QualityMetricGroupSettings(); QualityMetricGroup = new QualityMetricGroup(); }