public object Invoke(IObject obj, ICallable method, params object[] arguments) { Machine current = Machine.Current; try { this.machine.SetCurrent(); if (obj is ObjectProxy) { ObjectProxy proxy = (ObjectProxy)obj; if (proxy.HostId != this.Id) { throw new NotSupportedException(); } return(this.Invoke(proxy.ObjectId, method, arguments)); } return(obj.Invoke(method, arguments)); } finally { Machine.SetCurrent(current); } }
public object ResultToObject(object result) { if (result == null) { return(null); } if (!(result is IObject)) { return(result); } if (this.objectids.ContainsKey(result)) { return(this.objectids[result]); } ObjectProxy proxy = new ObjectProxy(result, this); this.objectids[result] = proxy.ObjectId; this.proxies[proxy.ObjectId] = proxy; return(proxy); }
public object ResultToObject(object result) { if (result == null) return null; if (!(result is IObject)) return result; if (this.objectids.ContainsKey(result)) return this.objectids[result]; ObjectProxy proxy = new ObjectProxy(result, this); this.objectids[result] = proxy.ObjectId; this.proxies[proxy.ObjectId] = proxy; return proxy; }