/// <summary> /// /// </summary> /// <param name="connection"></param> public void RollbackTransaction([In][Out, MarshalAs(UnmanagedType.IDispatch)] object connection) { if (!Validate("RollbackTransaction")) { Invoker.ReleaseParamsArray(connection); return; } NetOffice.ADODBApi.Connection newConnection = Factory.CreateKnownObjectFromComProxy <NetOffice.ADODBApi.Connection>(EventClass, connection, typeof(NetOffice.ADODBApi.Connection)); (newConnection as ICOMProxyShareProvider).GetProxyShare().Acquire(); object[] paramsArray = new object[1]; paramsArray.SetValue(connection, 0); EventBinding.RaiseCustomEvent("RollbackTransaction", ref paramsArray); connection = newConnection.UnderlyingObject; (newConnection as ICOMProxyShareProvider).GetProxyShare().Release(); }
public void BeforeCommitTransaction([In][Out] ref object cancel, [In][Out, MarshalAs(UnmanagedType.IDispatch)] object connection) { if (!Validate("BeforeCommitTransaction")) { Invoker.ReleaseParamsArray(connection); return; } NetOffice.ADODBApi.Connection newConnection = Factory.CreateKnownObjectFromComProxy <NetOffice.ADODBApi.Connection>(EventClass, connection, NetOffice.ADODBApi.Connection.LateBindingApiWrapperType); (newConnection as ICOMProxyShareProvider).GetProxyShare().Acquire(); object[] paramsArray = new object[2]; paramsArray.SetValue(cancel, 0); paramsArray.SetValue(newConnection, 1); EventBinding.RaiseCustomEvent("BeforeCommitTransaction", ref paramsArray); cancel = ToInt16(paramsArray[0]); connection = newConnection.UnderlyingObject; (newConnection as ICOMProxyShareProvider).GetProxyShare().Release(); }