|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法4 G! _0 K8 C4 l4 \
Technique 0 ?' e# A7 f/ ~2 j, ?$ u8 V
Use the Innovator.applyMethod() method to apply Generic Methods. The following
( k0 C* q* C) F) Uexamples assume a server-side method named "Reverse String" exists, and that it
; ?" e! R; ~* Yreturns a result item containing the reversed contents of the <string> tag.
; ]- f; r( O; m) D- i3 P; |7 o. `" IJavaScript
1 t5 ?1 c6 B8 U2 u, ?- @9 a7 Svar inn = this.newInnovator();
U+ @# ]/ e% ~! R! Jvar results = inn.applyMethod("Reverse String", "<string>abc</string>"); 9 \- x8 K, B& X- n8 k; j
// You can also apply a generic client method but only from another client-side method
( ~! F) Y9 |5 Y" A. p$ n// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); - J7 e6 ~( Q+ u2 [6 S' M& i( @& @
return results.getResult(); // returns "cba" C# b) ]: Y7 x: J' f+ s
Innovator inn = this.newInnovator(); 2 v0 r% U1 t g1 K
Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
& q" T) s6 _6 s) }4 r- P6 v// Return a result item with "cba" as the contents of the Result tag % H; @: O* W; G; u9 l! c9 f
return inn.newResult(results.getResult());
5 N) z( C9 B' _1 @5 v2 HVB.Net
$ x+ @+ Q ]$ o2 `& mDim inn As Innovator = Me.newInnovator()
4 ]" s( T! `! B! c8 K( R. S0 {Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
9 V2 I2 l T; a% w' Return a result item With "cba" As the contents of the Result tag
+ l. N2 v- } ]2 l. PReturn inn.newResult(results.getResult()) 7 Q7 g9 \1 I# ^' g; D( F. P
6 Y% Q) n/ v' s |
|