|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法4 R9 m/ s2 N5 r: e6 D
Technique ( S4 ^0 k! a3 E0 Y) w8 @
Use the Innovator.applyMethod() method to apply Generic Methods. The following
) ]" A2 `2 ?3 C1 H2 xexamples assume a server-side method named "Reverse String" exists, and that it 3 Z+ z/ y! h* ~. s
returns a result item containing the reversed contents of the <string> tag.
- v% q' `# p% y$ lJavaScript 5 v) y0 g# x8 ~7 z
var inn = this.newInnovator();
9 D) y& C. v# g" @" Yvar results = inn.applyMethod("Reverse String", "<string>abc</string>");
' o. ?% L7 _2 C4 P// You can also apply a generic client method but only from another client-side method + v0 ?# ? q) C0 {5 C7 J
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); 8 n8 t) j, Z/ c# G& N; k, m
return results.getResult(); // returns "cba" C# 9 r# p" c; B; f$ e8 @
Innovator inn = this.newInnovator(); 9 a" ^8 g0 |$ d8 D8 E
Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
* b; g. X# V, e" C// Return a result item with "cba" as the contents of the Result tag 9 K* ?+ u. w! \$ ?
return inn.newResult(results.getResult());
2 p* F7 x) ^3 H3 V6 K0 PVB.Net
7 L2 i+ g+ S" f0 {4 eDim inn As Innovator = Me.newInnovator()
9 W, F$ \) G; I# `Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
8 U" ^" b$ ~8 \$ Z3 w' Return a result item With "cba" As the contents of the Result tag
5 M6 ~. {/ G! K7 MReturn inn.newResult(results.getResult())
2 I7 \7 G: ?9 e# v; Y9 h
2 n6 T4 f7 E, o w |
|