The OnComponentSave Event couldn't be triggered and no error is raised.
Below is the detailed code. The "initialized" and "event be subscribed" info can be found inside the Application log, but the "save component completed" message never is displayed. No other error or warning can be found neither. Any idea what's wrong here?
[TcmExtension("My Tridion Event System")]
public class Events : TcmExtension
{
public Events()
{
Logger.Instance.LogInfo("Initialized");
Subscribe();
}
public void Subscribe()
{
try
{
EventSystem.Subscribe<Component, SaveEventArgs>(OnComponentSaved, EventPhases.Initiated);
Logger.Instance.LogInfo("Event be subscribed");
}
catch (Exception ex)
{
Logger.Instance.LogError("Error : " + ex.Message);
throw ex;
}
}
private void OnComponentSaved(Component component, SaveEventArgs args, EventPhases phase)
{
Logger.Instance.LogInfo("Save component started");
}
}