|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法
" B+ o4 J- ^9 w a; fTechnique
7 _) p7 T6 X7 |1 Z: @ v* YUse the Innovator.applyMethod() method to apply Generic Methods. The following ; X9 j0 X, p8 b8 i
examples assume a server-side method named "Reverse String" exists, and that it 0 z9 `1 `+ C% F; A3 |; y% F; U
returns a result item containing the reversed contents of the <string> tag.
6 S, N7 ~' a( @& L; K" VJavaScript
, E$ _& O; {+ Y+ avar inn = this.newInnovator();
! K# L) q* L8 O3 D8 ?var results = inn.applyMethod("Reverse String", "<string>abc</string>");
8 P* f/ u$ ~; b' o8 x/ y* t- e// You can also apply a generic client method but only from another client-side method
8 m. q* z f( c2 a& O// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); # E' `( ]3 K2 t* m; Q
return results.getResult(); // returns "cba" C#
( J; Y- B7 }6 e( }( ]& A3 o S; VInnovator inn = this.newInnovator();
- x7 i$ I% X0 O) j% o: oItem results = inn.applyMethod("Reverse String", "<string>abc</string>"); 8 W: c# \* {3 B
// Return a result item with "cba" as the contents of the Result tag / b8 k6 M% p6 } A% w# J
return inn.newResult(results.getResult());
8 N7 U& ]) @" q5 JVB.Net
! y& ]1 c! _" v t$ [1 ~Dim inn As Innovator = Me.newInnovator()
( ~; T1 S3 B8 Y2 _; B) c; c# VDim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>") ; {" p4 a2 O" ^ K0 t" E0 [
' Return a result item With "cba" As the contents of the Result tag
; \. D) C9 P3 L7 Z9 }Return inn.newResult(results.getResult()) : d9 _: t Q" @' M: S% t
, \, _$ D9 m, N' w8 { |
|