I am writing event code for Tridion R5 in C# but i am facing some challenges while implementing it in tridion. Is there any reference for Tridion R5 event system documentation or some sample code i can have?
Thanks
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am writing event code for Tridion R5 in C# but i am facing some challenges while implementing it in tridion. Is there any reference for Tridion R5 event system documentation or some sample code i can have?
Thanks
You can write your 5.3 event system in C# as long as you make it Com-compatible (see https://msdn.microsoft.com/en-us/library/c3fd4a20.aspx).
Register it with regasm.
In your class, you can use the Tridion Interops to access the TOM.
From a very old thread on a very old (closed) forum...
If you do the following, Visual Studio will complete it for you:
Tridion.ContentManager.Interop.cm_tom.dll
, Tridion.ContentManager.Interop.cm_defines.dll
and Tridion.ContentManager.Interop.msxml4.dll
using System;
using System.Xml;
using Tridion.ContentManager.Interop.TDSDefines;
using Tridion.ContentManager.Interop.TDS;
using Tridion.ContentManager.Interop.msxml4;
namespace yourNamespace.goes.here
{
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ProgId("TDSEvents.Events")]
public sealed class Events : ITCMEvents
- At this point Visual Studio will propose that you press TAB and it will create all the methods for you.
Be aware that events that happen to use MSXML2 objects will cause problems in .NET due to serialization issues between COM and .NET, unless you're running on .NET 1.1 (which I seriously doubt).