Esempio n. 1
0
		public ApiWrapper(string dllPath)
		{
			_api = new Api(dllPath);

			try
			{
				var msg = new StringBuilder(_msgSize);
				var extEc = 0L;
				_api.SetConnectionStatusCallback(Marshaler.WrapDelegate<Api.ConnectionStatusCallback>(OnConnectionStatusCallback), ref extEc, msg, _msgSize).ThrowIfNeed(msg);

				msg = new StringBuilder(_msgSize);
				extEc = 0L;
				_api.SetTransactionsReply(Marshaler.WrapDelegate<Api.TransactionReplyCallback>(OnTransactionReplyCallback), ref extEc, msg, _msgSize);
			}
			catch (Exception)
			{
				_api.Dispose();
				throw;
			}
		}
Esempio n. 2
0
        public ApiWrapper(string dllPath)
        {
            _api = new Api(dllPath);

            try
            {
                var msg   = new StringBuilder(_msgSize);
                var extEc = 0L;
                _api.SetConnectionStatusCallback(Marshaler.WrapDelegate <Api.ConnectionStatusCallback>(OnConnectionStatusCallback), ref extEc, msg, _msgSize).ThrowIfNeed(msg);

                msg   = new StringBuilder(_msgSize);
                extEc = 0L;
                _api.SetTransactionsReply(Marshaler.WrapDelegate <Api.TransactionReplyCallback>(OnTransactionReplyCallback), ref extEc, msg, _msgSize);
            }
            catch (Exception)
            {
                _api.Dispose();
                throw;
            }
        }
Esempio n. 3
0
 protected override void DisposeManaged()
 {
     _api.Dispose();
     base.DisposeManaged();
 }