Hi everyone!
How to subscribe to events PI SDK models in C#?
Can show the correct example?
This example causes the error.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace TestApp { class Program { static void Main(string[] args) { PISDK.PISDK mysdk = new PISDK.PISDK(); PISDK.Server mysrv = mysdk.Servers.DefaultServer; mysrv.Events.OnClose += new PISDK._DServerEvents_OnCloseEventHandler(Events_OnClose); mysrv.Close(); Console.ReadLine(); } static void Events_OnClose(string OldUser) { Console.WriteLine("test"); } } }
Err: