【Aras二次开发源码】编写可其他方法的子程序的通用方法9 d( Y( r+ Q! w
Technique " p" c1 L, U& ^# ]Use the Innovator.applyMethod() method to apply Generic Methods. The following 7 c7 Q+ Z4 {) E5 s" A) d1 c5 `examples assume a server-side method named "Reverse String" exists, and that it 9 v& B" D) K7 m0 x3 K
returns a result item containing the reversed contents of the <string> tag. : D O6 r$ L) `0 ?5 DJavaScript 3 s6 \9 C, y Q% l& t" |var inn = this.newInnovator(); ! A) _4 m8 z1 w2 g" } T, { kvar results = inn.applyMethod("Reverse String", "<string>abc</string>"); ! A: _0 o2 X( o: V5 C
// You can also apply a generic client method but only from another client-side method $ p/ X- t, A5 g) U2 X$ C3 w) \
// var results = inn.applyMethod("Reverse String JS","<string>abc</string>","client"); 3 G* C2 A4 R; \% S
return results.getResult(); // returns "cba" C# $ Z3 }- |# q, X4 [$ b; k; M0 U
Innovator inn = this.newInnovator(); 8 H: B3 M: V( y5 {; _. x5 _! Y
Item results = inn.applyMethod("Reverse String", "<string>abc</string>"); 4 R0 q. {6 U! W L
// Return a result item with "cba" as the contents of the Result tag ; i1 i" K2 f) p4 H# [return inn.newResult(results.getResult()); + q) D" ?7 `# M5 C# EVB.Net 5 |6 z: P/ L9 T0 i4 V0 Y
Dim inn As Innovator = Me.newInnovator() ; s5 ?7 X+ z, S2 ?
Dim results As Item = inn.applyMethod("Reverse String", "<string>abc</string>") 9 `* {+ o1 d) H1 ?5 f
' Return a result item With "cba" As the contents of the Result tag + p2 C& V3 a+ `
Return inn.newResult(results.getResult()) # b+ i( m& O& t% ` 4 R+ z8 J& M; S" s
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech