|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法
5 `3 P$ J. v% n/ Z/ STechnique
3 d/ F5 Q! [ Z5 S5 X3 C8 b+ |% uUse the Innovator.applyMethod() method to apply Generic Methods. The following
8 b& ~9 F- e2 wexamples assume a server-side method named "Reverse String" exists, and that it ! N# [3 i" Y5 }* J' v: w! K
returns a result item containing the reversed contents of the <string> tag.
& T- O+ E6 q8 f7 F$ ~5 l jJavaScript # Z3 z. T9 A* i0 V, u% B, S) d6 }1 `
var inn = this.newInnovator(); 3 P; |/ P2 ]$ u$ ?
var results = inn.applyMethod("Reverse String", "<string>abc</string>");
6 S: [! m6 J$ ^, d& k$ ^/ W// You can also apply a generic client method but only from another client-side method , |; k. c1 d+ w/ |. b ~
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); 4 W: A f6 @; z4 |$ `% G" Z
return results.getResult(); // returns "cba" C# ) {, Z# y2 F" q6 |2 S0 D
Innovator inn = this.newInnovator();
5 K/ q# `3 b0 ]Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
& L9 T4 f8 E. ^, r) a N2 A( d// Return a result item with "cba" as the contents of the Result tag
& f& k( T% |- Greturn inn.newResult(results.getResult()); / K* J; A) z! M+ W' \
VB.Net # E( o* e8 B3 C' d2 P- q
Dim inn As Innovator = Me.newInnovator() . ^& B' B8 m3 r+ W6 B3 j' x5 |$ V
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>") + P3 ^3 K* @# @% y* e, o4 L
' Return a result item With "cba" As the contents of the Result tag ! P) p; j6 V4 P [* ?( j. d
Return inn.newResult(results.getResult())
0 j. a* X: c3 Q! x2 Z$ g
& X" e9 _2 ?6 _+ r: x$ q5 u/ M; u& ` |
|