|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法5 u1 T- a( @. G2 m" v+ x/ K7 \
Technique
0 b+ `/ r8 P; r/ @! UUse the Innovator.applyMethod() method to apply Generic Methods. The following 8 S. J; G. y) L9 J, ?* [8 E
examples assume a server-side method named "Reverse String" exists, and that it ; N. H9 O& Q- @ W' k4 y4 E
returns a result item containing the reversed contents of the <string> tag.
3 O! e; x( _: H8 eJavaScript ' b) J) n' z" {# r" ]
var inn = this.newInnovator(); 3 w2 D5 N: N1 H
var results = inn.applyMethod("Reverse String", "<string>abc</string>"); 5 d: k7 E8 ]3 v' t% y& Z0 s
// You can also apply a generic client method but only from another client-side method
+ Q# V5 U: k4 h// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); 7 h; ?2 D. x5 A7 v
return results.getResult(); // returns "cba" C# ! k: y* q8 R6 B4 w [0 H$ O3 u
Innovator inn = this.newInnovator();
8 w" I, k% Y2 I' X, d! RItem results = inn.applyMethod("Reverse String", "<string>abc</string>"); 4 @9 D6 J) b$ j/ [# Y3 J; R
// Return a result item with "cba" as the contents of the Result tag
8 H! `& C( L0 o' xreturn inn.newResult(results.getResult());
% }3 h, U( m) ~VB.Net % D6 x* w; {# i: ^3 M8 E
Dim inn As Innovator = Me.newInnovator()
, K k7 c T$ g# t+ JDim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
7 m1 h8 ?! C8 d7 f$ v# y' Return a result item With "cba" As the contents of the Result tag
' V; g a/ Z! o/ dReturn inn.newResult(results.getResult())
. Q; \3 r; b& R0 a( |& `; }+ e+ H( W- S, e$ Y: w/ T* Q( f2 t# p$ O
|
|