public void BeforeDropOrPaste([In, MarshalAs(UnmanagedType.IDispatch)] object cancel, [In, MarshalAs(UnmanagedType.IDispatch)] object control, [In] object action, [In, MarshalAs(UnmanagedType.IDispatch)] object data, [In] object x, [In] object y, [In, MarshalAs(UnmanagedType.IDispatch)] object effect, [In] object shift) { Delegate[] recipients = _eventBinding.GetEventRecipients("BeforeDropOrPaste"); if ((true == _eventClass.IsCurrentlyDisposing) || (recipients.Length == 0)) { Invoker.ReleaseParamsArray(cancel, control, action, data, x, y, effect, shift); return; } NetOffice.MSFormsApi.ReturnBoolean newCancel = Factory.CreateObjectFromComProxy(_eventClass, cancel) as NetOffice.MSFormsApi.ReturnBoolean; NetOffice.MSFormsApi.Control newControl = Factory.CreateObjectFromComProxy(_eventClass, control) as NetOffice.MSFormsApi.Control; NetOffice.MSFormsApi.Enums.fmAction newAction = (NetOffice.MSFormsApi.Enums.fmAction)action; NetOffice.MSFormsApi.DataObject newData = Factory.CreateObjectFromComProxy(_eventClass, data) as NetOffice.MSFormsApi.DataObject; Single newX = Convert.ToSingle(x); Single newY = Convert.ToSingle(y); NetOffice.MSFormsApi.ReturnEffect newEffect = Factory.CreateObjectFromComProxy(_eventClass, effect) as NetOffice.MSFormsApi.ReturnEffect; Int16 newShift = Convert.ToInt16(shift); object[] paramsArray = new object[8]; paramsArray[0] = newCancel; paramsArray[1] = newControl; paramsArray[2] = newAction; paramsArray[3] = newData; paramsArray[4] = newX; paramsArray[5] = newY; paramsArray[6] = newEffect; paramsArray[7] = newShift; _eventBinding.RaiseCustomEvent("BeforeDropOrPaste", ref paramsArray); }
/// <summary> /// /// </summary> /// <param name="cancel"></param> /// <param name="action"></param> /// <param name="data"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="effect"></param> /// <param name="shift"></param> public void BeforeDropOrPaste([In, MarshalAs(UnmanagedType.IDispatch)] object cancel, [In] object action, [In, MarshalAs(UnmanagedType.IDispatch)] object data, [In] object x, [In] object y, [In, MarshalAs(UnmanagedType.IDispatch)] object effect, [In] object shift) { if (!Validate("BeforeDragOver")) { Invoker.ReleaseParamsArray(cancel, action, data, x, y, effect, shift); return; } NetOffice.MSFormsApi.ReturnBoolean newCancel = Factory.CreateKnownObjectFromComProxy <NetOffice.MSFormsApi.ReturnBoolean>(EventClass, cancel, typeof(NetOffice.MSFormsApi.ReturnBoolean)); NetOffice.MSFormsApi.Enums.fmAction newAction = (NetOffice.MSFormsApi.Enums.fmAction)action; NetOffice.MSFormsApi.DataObject newData = Factory.CreateKnownObjectFromComProxy <NetOffice.MSFormsApi.DataObject>(EventClass, data, typeof(NetOffice.MSFormsApi.DataObject)); Single newX = ToSingle(x); Single newY = ToSingle(y); NetOffice.MSFormsApi.ReturnEffect newEffect = Factory.CreateKnownObjectFromComProxy <NetOffice.MSFormsApi.ReturnEffect>(EventClass, effect, typeof(NetOffice.MSFormsApi.ReturnEffect)); Int16 newShift = ToInt16(shift); object[] paramsArray = new object[7]; paramsArray[0] = newCancel; paramsArray[1] = newAction; paramsArray[2] = newData; paramsArray[3] = newX; paramsArray[4] = newY; paramsArray[5] = newEffect; paramsArray[6] = newShift; EventBinding.RaiseCustomEvent("BeforeDropOrPaste", ref paramsArray); }