Hi
I am trying to create an automation (class library) in C#.
The automation has one event.
Can someone please tell me how an automation needs to look like in order for Navision to be able to see the event and automatically generate the trigger for the event that my automation provides (MyAutomation::MyEvent...).
Here's what I have so far:
using System;
using System.Runtime.InteropServices;
public delegate void MyDelegate();
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IMyClass
{
event MyDelegate MyEvent;
}
[ClassInterface(ClassInterfaceType.None)]
public class MyClass : IMyClass
{
public event MyDelegate MyEvent;
public void TriggerTheEvent()
{
if (MyEvent != null)
MyEvent();
}
}
/Frank Mortensen
0
Comments
Try this
http://www.mibuso.com/forum/viewtopic.php?t=8159
/Frank
What I did see a few times is when I forgot to set the property, saved the codeunit and discovered that it wasn't there. When I then set the property, it did not appear. I then had to remove the variable, save and close the codeunit, re-open it and create the variable with events. It's a pain in the neck sometimes, but those are things you should try before questioning your C# code.
RIS Plus, LLC
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I am unsure about the C# code though.
How can I set can I set an event public (or private) inside an interface?
/Frank
/Frank