public override void Install() { // settings _settingService.SaveSetting(new RChatSettings { numberOfHistoryMessages = 100, messageCharacterLimit = 1000, nameCharacterLimit = 10, throttleMilliseconds = 500, bannerText = "Welcome to RChat" }); _permissionService.InstallPermissions(new RChatPermissions()); RChatHistory.Resize(100); // locales _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.RChat.Name", "RChat"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.RChat.NumberOfHistoryMessages", "Number of History Messages"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.RChat.MessageCharacterLimit", "Message Character Limit"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.RChat.NameCharacterLimit", "Name Character Limit"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.RChat.ThrottleMilliseconds", "Throttle Milliseconds"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.RChat.BannerText", "Banner Text"); base.Install(); }
public RChatPlugin (ILocalizationService localizationService , ISettingService settingService , IStoreContext storeContext , IWebHelper webHelper , IPermissionService permissionService ) { _localizationService = localizationService; _settingService = settingService; _webHelper = webHelper; _permissionService = permissionService; RChatSettings rChatSettings = _settingService.LoadSetting <RChatSettings>(storeContext.CurrentStore.Id); RChatHistory.Resize(rChatSettings.numberOfHistoryMessages); }