本文整理汇总了C#中VirtualMachine.EncodeValues方法的典型用法代码示例。如果您正苦于以下问题:C# VirtualMachine.EncodeValues方法的具体用法?C# VirtualMachine.EncodeValues怎么用?C# VirtualMachine.EncodeValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtualMachine
的用法示例。
在下文中一共展示了VirtualMachine.EncodeValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginInvokeMultiple
//
// Implementation of InvokeMultiple
//
internal static IInvokeAsyncResult BeginInvokeMultiple (VirtualMachine vm, ThreadMirror thread, MethodMirror[] methods, Value this_obj, IList<IList<Value>> arguments, InvokeOptions options, AsyncCallback callback, object state) {
if (thread == null)
throw new ArgumentNullException ("thread");
if (methods == null)
throw new ArgumentNullException ("methods");
foreach (var m in methods)
if (m == null)
throw new ArgumentNullException ("method");
if (arguments == null) {
arguments = new List<IList<Value>> ();
for (int i = 0; i < methods.Length; ++i)
arguments.Add (new Value [0]);
} else {
// FIXME: Not needed for property evaluation
throw new NotImplementedException ();
}
if (callback == null)
throw new ArgumentException ("A callback argument is required for this method.", "callback");
InvokeFlags f = InvokeFlags.NONE;
if ((options & InvokeOptions.DisableBreakpoints) != 0)
f |= InvokeFlags.DISABLE_BREAKPOINTS;
if ((options & InvokeOptions.SingleThreaded) != 0)
f |= InvokeFlags.SINGLE_THREADED;
InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback, NumPending = methods.Length, IsMultiple = true };
var mids = new long [methods.Length];
for (int i = 0; i < methods.Length; ++i)
mids [i] = methods [i].Id;
var args = new List<ValueImpl[]> ();
for (int i = 0; i < methods.Length; ++i)
args.Add (vm.EncodeValues (arguments [i]));
thread.InvalidateFrames ();
r.ID = vm.conn.VM_BeginInvokeMethods (thread.Id, mids, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), args, f, InvokeMultipleCB, r);
return r;
}
示例2: BeginInvokeMethod
internal static IInvokeAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
if (thread == null)
throw new ArgumentNullException ("thread");
if (method == null)
throw new ArgumentNullException ("method");
if (arguments == null)
arguments = new Value [0];
InvokeFlags f = InvokeFlags.NONE;
if ((options & InvokeOptions.DisableBreakpoints) != 0)
f |= InvokeFlags.DISABLE_BREAKPOINTS;
if ((options & InvokeOptions.SingleThreaded) != 0)
f |= InvokeFlags.SINGLE_THREADED;
if ((options & InvokeOptions.ReturnOutThis) != 0)
f |= InvokeFlags.OUT_THIS;
if ((options & InvokeOptions.ReturnOutArgs) != 0)
f |= InvokeFlags.OUT_ARGS;
InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
thread.InvalidateFrames ();
r.ID = vm.conn.VM_BeginInvokeMethod (thread.Id, method.Id, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), vm.EncodeValues (arguments), f, InvokeCB, r);
return r;
}