At.FF.Krems.Config_Gui.MainWindow.SetViewModelProperties C# (CSharp) Method

SetViewModelProperties() private method

Sets the view model properties.
private SetViewModelProperties ( BrowserConfig config ) : void
config BrowserConfig The configuration.
return void
        private void SetViewModelProperties(BrowserConfig config)
        {
            this.ViewModel.DisableScreensaverPermanently = config.DisableScreensaverPermanently;

            // Print settings
            this.ViewModel.PrintUrl = config.PrintSettings.PrintUrl;
            this.ViewModel.PrintPort = config.PrintSettings.PrintPort;
            this.ViewModel.PrintEnabled = config.PrintSettings.PrintEnabled;
            this.ViewModel.PrintOnEmergency = config.PrintSettings.PrintOnEmergency;
            this.ViewModel.NumberOfPagesPerClick = config.PrintSettings.NumberOfPagesPerClick;
            this.ViewModel.NumberOfPagesOnEmergency = config.PrintSettings.NumberOfPagesOnEmergency;
            this.ViewModel.MapType = config.PrintSettings.MapType;
            this.ViewModel.MaxHydrants = config.PrintSettings.MaxHydrants;

            this.ViewModel.Runtime = config.Runtime;
            this.ViewModel.ScreenRefresherDuration = config.ScreenRefresher.Duration;
            this.ViewModel.ScreenRefresherEnabled = config.ScreenRefresher.Enabled;
            this.ViewModel.ScreenRefresherHeight = config.ScreenRefresher.Height;
            this.ViewModel.ScreenRefresherInterval = config.ScreenRefresher.Interval;
            this.ViewModel.ScreenRefresherRunAtStartup = config.ScreenRefresher.RunAtStartup;
            this.ViewModel.ProxyPort = config.Proxy.Port;
            this.ViewModel.ProxyServer = config.Proxy.Server;
            this.ViewModel.ProxyType = config.Proxy.Type;
            this.ViewModel.ProxyUrl = config.Proxy.Url;
            this.ViewModel.Cookies.Clear();
            if (config.Cookie != null && config.Cookie.Any())
            {
                foreach (var cookie in config.Cookie)
                {
                    this.ViewModel.Cookies.Add(cookie);
                }

                this.ViewModel.SelectedCookie = this.ViewModel.Cookies.First();
            }

            this.ViewModel.Windows.Clear();
            if (config.Window != null && config.Window.Any())
            {
                foreach (var window in config.Window)
                {
                    this.ViewModel.Windows.Add(window);
                }

                this.ViewModel.SelectedWindow = this.ViewModel.Windows.First();
            }
        }