}         // ApplySettings

        // ----------------------------------------------------------------------
        private void SettingsWindowClosing(object sender, CancelEventArgs e)
        {
            UserSettingsWindow userSettingsWindow = Current.MainWindow as UserSettingsWindow;

            if (userSettingsWindow != null)
            {
                appSettings.HostName = userSettingsWindow.HostName;
            }
        }         // SettingsWindowClosing
        }         // OnActivated

        // ----------------------------------------------------------------------
        private void ApplySettings()
        {
            if (settingsApplied)
            {
                return;
            }

            // window settings
            UserSettingsWindow userSettingsWindow = Current.MainWindow as UserSettingsWindow;

            if (userSettingsWindow != null)
            {
                userSettingsWindow.HostName = appSettings.HostName;
                userSettingsWindow.Closing += SettingsWindowClosing;
            }

            settingsApplied = true;
        }         // ApplySettings