|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法/ V" F2 c4 u, T, G& z2 y' z; m4 g
Technique 4 \; D" T# v3 S- ~. |
Use the Innovator.applyMethod() method to apply Generic Methods. The following , G5 F8 w* t6 R* g
examples assume a server-side method named "Reverse String" exists, and that it $ T0 S+ l" d3 o1 z+ }/ m' v
returns a result item containing the reversed contents of the <string> tag.
' y5 t R& a2 ~" {! AJavaScript _' {7 g {/ ]" y
var inn = this.newInnovator(); 9 O' e0 \7 ] s+ S6 w0 h
var results = inn.applyMethod("Reverse String", "<string>abc</string>");
: a0 [! }5 s* ~, X// You can also apply a generic client method but only from another client-side method % L+ J9 I( l, C' t
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client");
5 x3 B T# j/ |9 }return results.getResult(); // returns "cba" C#
1 l7 G1 K8 ^# Q* kInnovator inn = this.newInnovator(); 8 q9 T9 o# z" u
Item results = inn.applyMethod("Reverse String", "<string>abc</string>"); \$ m4 e& R- K$ G# s) Z, D% |
// Return a result item with "cba" as the contents of the Result tag ' P! X0 s0 \3 Y4 c% \
return inn.newResult(results.getResult());
* _, r( |) W" dVB.Net
" P# I$ S5 X6 l! _ XDim inn As Innovator = Me.newInnovator() $ X; ~+ K; v1 W' A8 q3 f' h" K5 o
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>") - g) i* c2 [ @3 m/ s- R
' Return a result item With "cba" As the contents of the Result tag : G( u" ~; V9 R& `& r: l8 K
Return inn.newResult(results.getResult())
+ ?( I8 I+ @' C) n0 d* ]
0 X/ B5 C' ]( U4 P& L' T |
|