Exemplo n.º 1
0
        public string Initialize(string path, short logLevel)
        {
            using (var encoder = new UTF8Encoder())
            {
                encoder.SetData(path);

                pResult = TXmlConnectorHelper.Initialize(encoder.Data, logLevel);

                return(pResult.ToStringUTF8());
            }
        }
Exemplo n.º 2
0
        public string SendCommand(string command)
        {
            using (var encoder = new UTF8Encoder())
            {
                encoder.SetData(command);

                pResult = TXmlConnectorHelper.SendCommand(encoder.Data);

                return(pResult.ToStringUTF8());
            }
        }
Exemplo n.º 3
0
        private async Task RaiseEventAsync(IntPtr pData)
        {
            string arg = pData.ToStringUTF8();

            await Task.Run(() => TXmlConnectorHelper.FreeMemory(pData));

            foreach (var @event in callbacks.Values)
            {
                @event.Callback(arg);

                await Task.Yield();
            }
        }
Exemplo n.º 4
0
        public void Subscribe(string tagEvent, IEventCallback eventCallback)
        {
            if (!TXmlConnectorHelper.SetCallback(connectorCallback))
            {
                throw (new TransaqConnectorException());
            }

            if (!TXmlConnectorHelper.SetCallbackEx(connectorCallbackEx, IntPtr.Zero))
            {
                throw (new TransaqConnectorException());
            }

            callbacks.Add(tagEvent, eventCallback);
        }
Exemplo n.º 5
0
        public void Dispose()
        {
            TXmlConnectorHelper.FreeMemory(pResult);

            pResult = IntPtr.Zero;
        }
Exemplo n.º 6
0
        public string Finalize()
        {
            pResult = TXmlConnectorHelper.UnInitialize();

            return(pResult.ToStringUTF8());
        }