Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey,
it is possible to hint the save event for dictionary items? :)
Hi Again :)
Can do it like this.
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { LocalizationService.SavedDictionaryItem += SavedDictionaryItem; } private void SavedDictionaryItem(ILocalizationService sv, SaveEventArgs<IDictionaryItem> args) { // Do magic here }
You do this inside of ApplicationEventHandler. https://our.umbraco.com/documentation/reference/events/application-startup
Hi Again! :D
When i'm debugging this. Then i'm not hitting my test, test ?
class GetDictionaryItems : ApplicationEventHandler { public new void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { LocalizationService.SavedDictionaryItem += SavedDictionaryItem; } private void SavedDictionaryItem(ILocalizationService sv, SaveEventArgs<IDictionaryItem> args) { var test = sv; var test2 = args; } }
Hi Thomas,
Is your GetDictionaryItems class public? If it's not, I think it might need to be for it to work.
Thanks
Nik
I just added. But that didn't help..
It does not need to be public.
You can see how I used it in the Dictionary package here:
https://github.com/Vettvangur/Vettvangur.DictionaryHelper
Startup File Here: https://github.com/Vettvangur/Vettvangur.DictionaryHelper/blob/master/Startup.cs
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Eventhandler for Dictionary items
Hey,
it is possible to hint the save event for dictionary items? :)
Hi Again :)
Can do it like this.
You do this inside of ApplicationEventHandler. https://our.umbraco.com/documentation/reference/events/application-startup
Hi Again! :D
When i'm debugging this. Then i'm not hitting my test, test ?
Hi Thomas,
Is your GetDictionaryItems class public? If it's not, I think it might need to be for it to work.
Thanks
Nik
I just added. But that didn't help..
It does not need to be public.
You can see how I used it in the Dictionary package here:
https://github.com/Vettvangur/Vettvangur.DictionaryHelper
Startup File Here: https://github.com/Vettvangur/Vettvangur.DictionaryHelper/blob/master/Startup.cs
is working on a reply...