|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法
4 V2 r" P) O6 ]; gTechnique / I! z/ G, w7 [0 n1 X5 e5 G( c' g: v5 R
Use the Innovator.applyMethod() method to apply Generic Methods. The following
1 J4 G! \5 O* g. dexamples assume a server-side method named "Reverse String" exists, and that it ) e8 O) A0 X! P5 `3 G0 d, w+ g* |
returns a result item containing the reversed contents of the <string> tag.
. O9 M7 a& u0 HJavaScript
2 E( }1 I( m" S, ~- Q$ J0 V2 D% J Cvar inn = this.newInnovator(); ' B$ [2 E$ I& M' N, k' u' y8 w9 E5 y
var results = inn.applyMethod("Reverse String", "<string>abc</string>"); - S' u8 D' O4 E. O& W7 B* {6 d
// You can also apply a generic client method but only from another client-side method 9 w& T1 Z9 t. z0 O" W% m* n
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); ; j6 T$ ^1 ?$ h/ N6 |
return results.getResult(); // returns "cba" C# B) l3 M! e- S& A! u
Innovator inn = this.newInnovator();
0 W9 S9 h8 Q6 f* m! J& LItem results = inn.applyMethod("Reverse String", "<string>abc</string>");
5 h$ a% j. K( F& i# J. d' G// Return a result item with "cba" as the contents of the Result tag
% T2 m) ^8 J z k* ]8 Y$ _return inn.newResult(results.getResult()); % z# W- t/ z6 m0 y9 [% l+ ~5 U
VB.Net
$ h* v1 @3 x/ G- HDim inn As Innovator = Me.newInnovator() - b( t, L% Q! i% n/ y3 k/ R
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
% ~) i1 X% N# `. ~& |" \9 C% X' Return a result item With "cba" As the contents of the Result tag , ~7 P) S" C5 L# G1 }) ^
Return inn.newResult(results.getResult())
* F, g& E' m% ^7 r: V7 v9 f
/ T2 \( @9 F1 S' _3 p6 ^& c- g |
|