public override void Define(ISettingDefinitionContext context) { var smtpPassword = context.GetOrNull(EmailSettings.PasswordKey); if (smtpPassword != null) { smtpPassword.IsEncrypted = false; } }
public override void Define(ISettingDefinitionContext context) { //Define your own settings here. Example: //context.Add(new SettingDefinition(BookStoreSettings.MySetting1)); var a = context.GetAll(); var b = context.GetOrNull("Abp.Mailing.Smtp.Host"); context.Add(new SettingDefinition(BookStoreSettings.CurrentEnvironment, "DEV")); context.Add(new SettingDefinition("sett1", "s1")); context.Add(new SettingDefinition("sett2", "s2")); }
public override void Define(ISettingDefinitionContext context) { var smtpHost = context.GetOrNull("Smtp.UserName"); if (smtpHost != null) { smtpHost.DefaultValue = "*****@*****.**"; smtpHost.DisplayName = new LocalizableString(typeof(TestResource), "SmtpServer_DisplayName"); } context.Add(new SettingDefinition("Example.Setting1", "www.xcode.me")); context.Add(new SettingDefinition("Example.Setting2")); context.Add(new SettingDefinition("Example.Setting3")); }
// 在某些情况下,你可能希望更改应用程序/模块所依赖的其他模块中定义的设置的某些属性. 设置定义提供程序可以查询和更新设置定义. // 下面的示例中获取了由 Volo.Abp.Emailing 包定义的设置并将其更改: public override void Define(ISettingDefinitionContext context) { var smtpHost = context.GetOrNull("Abp.Mailing.Smtp.Host"); if (smtpHost != null) { smtpHost.DefaultValue = "mail.mydomain.com"; //smtpHost.DisplayName = // new LocalizableString( // typeof(MyLocalizationResource), // "SmtpServer_DisplayName" // ); } }
public override void Define(ISettingDefinitionContext context) { var smtpHost = context.GetOrNull("Abp.Mailing.Smtp.Host"); if (smtpHost != null) { smtpHost.DefaultValue = "mail.mydomain.com"; /*smtpHost.DisplayName = * new LocalizableString( * typeof(EmailMarketingLocalizationResource), * "SmtpServer_DisplayName" * );*/ } }
public override void Define(ISettingDefinitionContext context) { // set default language var languageSetting = context.GetOrNull(LocalizationSettingNames.DefaultLanguage); if (languageSetting != null) { languageSetting.DefaultValue = ModuleConsts.DefaultCultureName; } // Define your own settings here. Example: context.Add(new SettingDefinition( name: ProjectsSettingNames.ModuleName, defaultValue: "Projects", displayName: L("Setting:MySetting1") )); }