|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法/ j- j" I( x8 A2 m' Z4 l" p4 n
Technique 7 ?: V9 }+ l1 u
Use the Innovator.applyMethod() method to apply Generic Methods. The following ; @1 l: ]/ E" c( h
examples assume a server-side method named "Reverse String" exists, and that it
. F+ h6 Y; z. @, `$ [& W- ?. E2 ?returns a result item containing the reversed contents of the <string> tag.
2 u3 W, o, ?5 a' t! v% \7 b5 w# mJavaScript : e( E) E" t( c4 t2 [3 i
var inn = this.newInnovator();
6 J, x' S: x$ Y z* P1 ovar results = inn.applyMethod("Reverse String", "<string>abc</string>"); . _+ d% z( S0 B2 ]
// You can also apply a generic client method but only from another client-side method
" c# r! i5 t6 k0 U$ i6 E// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client");
# [4 Y4 \. i' Y. ?0 z! n/ k0 ?' Yreturn results.getResult(); // returns "cba" C# 9 c% L' Y' d) f! R' g3 \; X
Innovator inn = this.newInnovator(); . I4 S4 d7 N9 o. s) F
Item results = inn.applyMethod("Reverse String", "<string>abc</string>"); # @8 f1 \. C8 M
// Return a result item with "cba" as the contents of the Result tag 8 S0 ]) a& S9 Z/ Q. b
return inn.newResult(results.getResult()); ! }: r% ~: g4 C* Y2 f
VB.Net ( Y- r ?) Y" {
Dim inn As Innovator = Me.newInnovator()
0 }/ A7 Z7 W" K' j& |6 ]Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
* V* C9 w% u. R1 J3 a! ^, x" w6 d' Return a result item With "cba" As the contents of the Result tag 2 u0 b4 G3 \( T6 B, Z# K$ w3 I
Return inn.newResult(results.getResult())
& F) w0 T3 u: n/ }( X9 d& _: e5 R. v9 c4 C- n& s$ M1 U9 ^
|
|