|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法* v: d3 r& X) ^$ t/ s Y
Technique
- e& M- W$ `+ k) o0 |# w* ]2 r7 `Use the Innovator.applyMethod() method to apply Generic Methods. The following ! V7 z: ~9 p4 C( L/ x
examples assume a server-side method named "Reverse String" exists, and that it + ], I" u; Q3 a7 l2 n4 u D
returns a result item containing the reversed contents of the <string> tag.
$ G. s1 b" W, _* v2 dJavaScript 9 r6 v, y- z1 h# F
var inn = this.newInnovator();
8 Y% y- } [% w7 T4 ^' Z% B6 Mvar results = inn.applyMethod("Reverse String", "<string>abc</string>"); , M5 i7 k- x i& K
// You can also apply a generic client method but only from another client-side method e1 e, ^( ]* Y5 M4 n7 h% A' @. {6 V3 m
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client");
' n d3 Q, t, d8 t# z7 I; Greturn results.getResult(); // returns "cba" C# 6 a4 @( g4 y; p s! w4 o" [' B
Innovator inn = this.newInnovator(); 0 U$ \5 L5 ]& z/ w ~
Item results = inn.applyMethod("Reverse String", "<string>abc</string>");
% c- J' s ]& C% s/ p// Return a result item with "cba" as the contents of the Result tag + H8 n& I0 Y; ~+ Q6 X
return inn.newResult(results.getResult()); , {! t+ Z2 U# V$ y
VB.Net
# ]/ ?# R. n! |% Z" RDim inn As Innovator = Me.newInnovator()
; j# ~5 g! `* L5 z- `Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>") 3 x% ]% a$ H: f* Y0 p' P
' Return a result item With "cba" As the contents of the Result tag
) x' K; b: Z f7 T/ [8 mReturn inn.newResult(results.getResult()) 4 ^+ p6 j7 T! k
4 `5 ~, N( S" X* x! S7 l
|
|