本文整理汇总了C#中tcl.lang.Interp.transferResult方法的典型用法代码示例。如果您正苦于以下问题:C# Interp.transferResult方法的具体用法?C# Interp.transferResult怎么用?C# Interp.transferResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tcl.lang.Interp
的用法示例。
在下文中一共展示了Interp.transferResult方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: cmdProc
public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv )
{
targetInterp.preserve();
targetInterp.nestLevel++;
targetInterp.resetResult();
targetInterp.allowExceptions();
// Append the arguments to the command prefix and invoke the command
// in the target interp's global namespace.
TclObject[] prefv = TclList.getElements( interp, prefix );
TclObject cmd = TclList.newInstance();
cmd.preserve();
TclList.replace( interp, cmd, 0, 0, prefv, 0, prefv.Length - 1 );
TclList.replace( interp, cmd, prefv.Length, 0, argv, 1, argv.Length - 1 );
TclObject[] cmdv = TclList.getElements( interp, cmd );
TCL.CompletionCode result = targetInterp.invoke( cmdv, Interp.INVOKE_NO_TRACEBACK );
cmd.release();
targetInterp.nestLevel--;
// Check if we are at the bottom of the stack for the target interpreter.
// If so, check for special return codes.
if ( targetInterp.nestLevel == 0 )
{
if ( result == TCL.CompletionCode.RETURN )
{
result = targetInterp.updateReturnInfo();
}
if ( result != TCL.CompletionCode.OK && result != TCL.CompletionCode.ERROR )
{
try
{
targetInterp.processUnexpectedResult( result );
}
catch ( TclException e )
{
result = e.getCompletionCode();
}
}
}
targetInterp.release();
interp.transferResult( targetInterp, result );
return TCL.CompletionCode.RETURN;
}
示例2: hide
internal static void hide( Interp interp, Interp slaveInterp, int objIx, TclObject[] objv )
{
if ( interp.isSafe )
{
throw new TclException( interp, "permission denied: " + "safe interpreter cannot hide commands" );
}
int nameIdx = objv.Length - objIx == 1 ? objIx : objIx + 1;
try
{
slaveInterp.hideCommand( objv[objIx].ToString(), objv[nameIdx].ToString() );
}
catch ( TclException e )
{
interp.transferResult( slaveInterp, e.getCompletionCode() );
throw;
}
}
示例3: invokeHidden
internal static void invokeHidden( Interp interp, Interp slaveInterp, bool global, int objIx, TclObject[] objv )
{
TCL.CompletionCode result;
if ( interp.isSafe )
{
throw new TclException( interp, "not allowed to " + "invoke hidden commands from safe interpreter" );
}
slaveInterp.preserve();
slaveInterp.allowExceptions();
TclObject[] localObjv = new TclObject[objv.Length - objIx];
for ( int i = 0; i < objv.Length - objIx; i++ )
{
localObjv[i] = objv[i + objIx];
}
try
{
if ( global )
{
slaveInterp.invokeGlobal( localObjv, Interp.INVOKE_HIDDEN );
}
else
{
slaveInterp.invoke( localObjv, Interp.INVOKE_HIDDEN );
}
result = slaveInterp.returnCode;
}
catch ( TclException e )
{
result = e.getCompletionCode();
}
slaveInterp.release();
interp.transferResult( slaveInterp, result );
}
示例4: eval
internal static void eval( Interp interp, Interp slaveInterp, int objIx, TclObject[] objv )
{
TCL.CompletionCode result;
slaveInterp.preserve();
slaveInterp.allowExceptions();
try
{
if ( objIx + 1 == objv.Length )
{
slaveInterp.eval( objv[objIx], 0 );
}
else
{
TclObject obj = TclList.newInstance();
for ( int ix = objIx; ix < objv.Length; ix++ )
{
TclList.append( interp, obj, objv[ix] );
}
obj.preserve();
slaveInterp.eval( obj, 0 );
obj.release();
}
result = slaveInterp.returnCode;
}
catch ( TclException e )
{
result = e.getCompletionCode();
}
slaveInterp.release();
interp.transferResult( slaveInterp, result );
}