コード例 #1
0
        private void LoadEmailServerSettings()
        {
            EmailServerSettings = new EmailServerSettingsModel()
            {
                Server = (string)ApplicationSettings.Read("Server"),
                Username = (string)ApplicationSettings.Read("Username"),
                Password = (string)ApplicationSettings.Read("Password"),
            };

            var enableSsl = ApplicationSettings.Read("EnableSsl");

            if (enableSsl != null)
                EmailServerSettings.EnableSsl = Convert.ToBoolean(enableSsl);

            var port = ApplicationSettings.Read("Port");

            if (port != null)
                EmailServerSettings.Port = Convert.ToInt32(port);

            EmailServerSettings.PropertyChanged += EmailServerSettings_PropertyChanged;
        }
コード例 #2
0
ファイル: EmailService.cs プロジェクト: syatin003/Wpf
        private static EmailServerSettingsModel PrepareSettings()
        {
            var settings = new EmailServerSettingsModel()
            {
                Server = (string)ApplicationSettings.Read("Server"),
                Username = (string)ApplicationSettings.Read("Username"),
                Password = (string)ApplicationSettings.Read("Password"),
            };

            var enableSsl = ApplicationSettings.Read("EnableSsl");

            if (enableSsl != null)
                settings.EnableSsl = Convert.ToBoolean(enableSsl);

            var port = ApplicationSettings.Read("Port");

            if (port != null)
                settings.Port = Convert.ToInt32(port);

            return settings;
        }