I have tried to register my methods like this:
[InitializableModule]
public class ResizeTest : IInitializableModule
{
private bool _eventsAttached = false;
public void Initialize(InitializationEngine context)
{
if (!_eventsAttached)
{
DataFactory.Instance.CreatedContent += MyTestEvent;
DataFactory.Instance.CheckedInContent += MyTestEvent;
DataFactory.Instance.CheckingInContent += MyTestEvent;
DataFactory.Instance.CreatingPage += MyTestEvent;
_eventsAttached = true;
}
}
public void Uninitialize(InitializationEngine context)
{
DataFactory.Instance.CreatedContent -= MyTestEvent;
}
public void Preload(string[] parameters)
{
}
void MyTestEvent(object sender, ContentEventArgs e)
{
//do something here
}
}
Doing so, the only event I am able to trigger(through debugging) is CreatingPage, when I try to create a new page. As explained above, I want to do some processing on images after they are uploaded. When reading the SDK I get the impression that CheckingInContent or CheckedInContent are the correct events to listen to. Am I doing something wrong?
Solved with :
UnifiedFile.UnifiedFileCheckedIn += MyTestEvent;
UnifiedFile.UnifiedFileCheckingIn += MyTestEvent;
UnifiedFile.UnifiedFileDeleting += MyTestEvent;
UnifiedFile.UnifiedFileDeleted += MyTestEvent;
Hi,
I am working on a site where there will be a large number of highres images added by editors. My job is to make sure the images are automatically resized into smaller versions for tablets and mobiles. My initial thought is to hook into one of the events triggered when the editor uploads images to the Global Files folder.
Anyone done this , or something similar?