|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法
4 G- e) U: Z9 d9 n3 a% JTechnique
' }5 M& ?. j4 b$ Q, ]3 IUse the Innovator.applyMethod() method to apply Generic Methods. The following
- ] j& k& i. _( V* @examples assume a server-side method named "Reverse String" exists, and that it
3 D" ~' I8 |# r" W5 R9 y6 l' m& Freturns a result item containing the reversed contents of the <string> tag.
1 A1 C6 {" N9 [; wJavaScript
% n" {& ^ a5 \$ H" }; Y0 Hvar inn = this.newInnovator();
7 b: z( |' }; {% Hvar results = inn.applyMethod("Reverse String", "<string>abc</string>"); ' ~3 |) ~9 x$ o ] T6 H+ s4 b
// You can also apply a generic client method but only from another client-side method
0 d4 R5 q, ?* T1 p// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); ! _+ G0 @. z/ g5 m, g
return results.getResult(); // returns "cba" C#
; P" H8 q6 E* a, ^Innovator inn = this.newInnovator(); H6 ^- P9 b6 ?/ W
Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
9 c( M, y; R3 j, c// Return a result item with "cba" as the contents of the Result tag ' z' [+ n& s" v0 X8 b! b
return inn.newResult(results.getResult());
4 x0 |% E* W5 T0 o, M/ _: N2 {VB.Net - `; V+ W: {8 h/ W" r& m
Dim inn As Innovator = Me.newInnovator() 5 F' n) N( M+ q/ d6 p# G
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>") 9 }6 r9 X6 B- x" S% y2 \9 c
' Return a result item With "cba" As the contents of the Result tag " Y1 C$ a$ Z* c8 P2 m
Return inn.newResult(results.getResult())
0 _7 |+ S1 _/ L7 p/ O/ Q
X0 \: J) S3 N- w |
|