|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
【Aras二次开发源码】编写可其他方法的子程序的通用方法
7 C! W2 X' K+ |% b- ~* u1 v/ STechnique
0 {2 s0 P. B! t. e! YUse the Innovator.applyMethod() method to apply Generic Methods. The following 5 `( x0 X4 d% B" d
examples assume a server-side method named "Reverse String" exists, and that it 3 D. w- k8 G- ~# c! ^
returns a result item containing the reversed contents of the <string> tag. 1 ?. P: P% c; U' l5 A8 Z0 K
JavaScript : f, b3 ?2 c5 p0 f2 M
var inn = this.newInnovator();
( g$ k U' ~+ `: T5 Yvar results = inn.applyMethod("Reverse String", "<string>abc</string>");
: V% C* l* T: k9 c. s// You can also apply a generic client method but only from another client-side method / ^$ m( r+ v3 V' d
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); ' u; m" x8 ?! H
return results.getResult(); // returns "cba" C#
; W9 `/ u% o. NInnovator inn = this.newInnovator();
$ ~% Y% c Z8 \# w BItem results = inn.applyMethod("Reverse String", "<string>abc</string>"); - _+ v2 [8 b# V$ ~9 V! r; r
// Return a result item with "cba" as the contents of the Result tag . \0 N+ y X- A: u9 g- ^
return inn.newResult(results.getResult()); ! P8 d+ N7 a1 L* \
VB.Net ; {9 A6 i0 G Z' I5 a& P! x5 y; [0 b
Dim inn As Innovator = Me.newInnovator()
8 m% `! r) L+ q- v0 E& m4 DDim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>")
- C3 d% L+ \$ S8 w6 V% l' Return a result item With "cba" As the contents of the Result tag Y: S8 D) t, `; s% T: K
Return inn.newResult(results.getResult()) 2 G+ S# K( Z5 R/ y% p
1 o7 v4 F+ ^& m, O! }/ U. I
|
|