|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法
9 \$ B3 w* {$ I' T8 b5 D4 fTechnique $ M. f6 @* d% q2 e/ f8 S
Use the Innovator.applyMethod() method to apply Generic Methods. The following ; v) `1 U7 A8 i; D8 P
examples assume a server-side method named "Reverse String" exists, and that it * b% E2 l* @+ {1 x6 S) J7 u
returns a result item containing the reversed contents of the <string> tag. 4 y/ F) t: w# e
JavaScript ; U) P6 }- m3 g. ~; }2 T+ G( A
var inn = this.newInnovator();
& t) v5 P# w2 G [var results = inn.applyMethod("Reverse String", "<string>abc</string>"); : p1 O% k% W3 E" Y8 ]" B: \
// You can also apply a generic client method but only from another client-side method
6 ?+ h( q9 P0 A8 ?// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); 7 A1 Z0 ~# O- C6 x; `5 c
return results.getResult(); // returns "cba" C# ' G9 R+ W+ L* \7 r8 [% `! s
Innovator inn = this.newInnovator(); ' E' x( E; ?6 x4 z( y" c/ A
Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
3 o/ j0 _! [: W$ X, R// Return a result item with "cba" as the contents of the Result tag 3 k' R! Q; O( U/ l( f: L7 n0 N& q
return inn.newResult(results.getResult());
* F6 f7 F/ q- o5 K8 F. YVB.Net
* W* A' f: q1 d; |) L1 u) GDim inn As Innovator = Me.newInnovator() ; U4 j: m, ~5 R
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
* o9 B' u) S6 j* \' Return a result item With "cba" As the contents of the Result tag & _& Q2 g) d- q. ^/ v- w2 }
Return inn.newResult(results.getResult()) * x+ u \9 k5 p3 ? T- n, E
# [3 `0 f0 I# o2 L U- ` |
|