示例#1
0
        }         // ApplySettings

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

            if (userSettingsWindow != null)
            {
                appSettings.HostName = userSettingsWindow.HostName;
            }
        }         // SettingsWindowClosing
示例#2
0
        }         // 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