private void OnLink(Ddeml.MONLINKSTRUCT mon) { // Get the service name from the hszSvc string handle. var psz = new StringBuilder(Ddeml.MAX_STRING_SIZE); var length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszSvc, psz, psz.Capacity, Ddeml.CP_WINANSI); var service = psz.ToString(); // Get the topic name from the hszTopic string handle. psz = new StringBuilder(Ddeml.MAX_STRING_SIZE); length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszTopic, psz, psz.Capacity, Ddeml.CP_WINANSI); var topic = psz.ToString(); // Get the item name from the hszItem string handle. psz = new StringBuilder(Ddeml.MAX_STRING_SIZE); length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hszItem, psz, psz.Capacity, Ddeml.CP_WINANSI); var item = psz.ToString(); var args = new DdemlLinkActivityEventArgs( service, topic, item, mon.wFmt, !mon.fNoData, mon.fEstablished, mon.fServer, mon.hConvClient, mon.hConvServer, mon.hTask); LinkActivity?.Invoke(this, args); }
/// <summary> /// Appends a new activity to the chain /// </summary> /// <param name="stageName">A description of the current activity</param> /// <param name="link">The stage logic</param> public void AddLink(string stageName, LinkActivity link) { _chain.Add(new Tuple <string, LinkActivity>(stageName, link)); }