|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法# g0 y4 A7 k$ t7 T& S7 p
Technique 4 D) D- y% E. P* e* o0 T" B/ y
Use the Innovator.applyMethod() method to apply Generic Methods. The following
( G* l7 q* |, h W; V0 o8 \examples assume a server-side method named "Reverse String" exists, and that it
2 i9 x: f) m* F! y( u7 ^: [returns a result item containing the reversed contents of the <string> tag.
# Q! {+ W, T: y2 P+ ~3 ^JavaScript 0 G% {7 Y, L4 L5 N6 F
var inn = this.newInnovator(); * _0 \9 Z9 L5 ^
var results = inn.applyMethod("Reverse String", "<string>abc</string>");
' _- _& i& \( L' ]// You can also apply a generic client method but only from another client-side method
# }2 z" U% Z$ ^( R" v5 G+ o+ p+ Q+ e// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client");
$ ?: f' T% ^5 T3 b/ @/ `return results.getResult(); // returns "cba" C#
P7 A; _, e- E$ F: N. ^9 `1 dInnovator inn = this.newInnovator(); 2 J! @8 h9 |+ q
Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
/ R% j* J9 s9 r+ p r) j5 O// Return a result item with "cba" as the contents of the Result tag
`) k0 ^% z3 j1 P, ureturn inn.newResult(results.getResult());
$ ^0 Q3 [* W6 f9 M( I& K4 [VB.Net 5 q1 G# O, O; Q% M! Q
Dim inn As Innovator = Me.newInnovator()
( G3 H1 }1 O* I1 O5 \6 X3 Q/ FDim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
( V' F, W5 A, I' Return a result item With "cba" As the contents of the Result tag
4 u3 D* ^/ Z- R0 XReturn inn.newResult(results.getResult())
" _6 \$ I3 T& C3 X; U# q9 X. }! j0 u6 K! o& S
|
|