[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Translate some Visual Studio code

Status
Not open for further replies.
D

DenDuze

Guest
Arrrrh, damn how stupid. Changed it but I get Invalid handle. Not initialized or points to deleted object (3135) I also tried with o2 = CAST (ReflectionHelper:InvokeGenericMethod( o, "Invoke", "Verpigo.Extensibility.ExtensionManager"), PaymentExtension_Adyen.AdyenPaymentHandlerExtension). But then I get System.Reflection.TargetParameterCountException: Parameter count mismatch. Like I already mentioned it's not clear to me what the original code just does: ExtensionManager.Instance.Invoke(Of IPaymentHandlerExtension)(Sub(x) x.HandlePayment(paymentId, amount, comment)). Maybe someone can explain me what this code just does because I tried multiple things but always get some kind of error The Invoke methos in ExtensionManager.vb: Public Sub Invoke(Of T)(act As Action(Of T)) For Each extension As IExtension In _extensions.Where(Function(e) GetType(t).IsAssignableFrom(e.GetType)) Dim extOfT = DirectCast(extension, T) act(extOfT) Next End Sub The HandlePayment method in AdyenPaymentHandlerExtension;vb: Public Function HandlePayment(paymentMethodId As Integer, amount As Single, comment As String) As Boolean Implements IPaymentHandlerExtension.HandlePayment 'only handle the payment codes that are configured in the config file If Not AcceptedPaymentMethodIds.Contains(paymentMethodId) Then Return False End If Parameters = New List(Of String) From {"-a", amount.ToString(CultureInfo.InvariantCulture), "-c", comment} Return RunProcess() = 0 'external process has to return 0 if everything is OK End Function So I really have no idea it that is translatable to Progress or not (and how)

Continue reading...
 
Status
Not open for further replies.
Top