public void AddVMProxyArg(VMProxyArg vmpa) { string contextReference = vmpa.ContextReference; if (vmpa.isConstant()) { this.localcontext[contextReference] = vmpa.getObject(this.wrappedContext); } else { this.vmproxyhash[contextReference] = vmpa; } }
/// <summary> Impl of the Context.gut() method. /// * /// </summary> /// <param name="key">name of item to get /// </param> /// <returns> stored object or null /// /// </returns> public Object Get(String key) { /* * first, see if it's a VMPA */ Object o = null; VMProxyArg vmpa = (VMProxyArg)vmproxyhash[key]; if (vmpa != null) { o = vmpa.getObject(wrappedContext); } else { if (localcontextscope) { /* * if we have localcontextscope mode, then just * put in the local context */ o = localcontext[key]; } else { /* * try the local context */ o = localcontext[key]; if (o == null) { /* * last chance */ o = innerContext.Get(key); } } } return(o); }
/// <summary> return the inner / user context /// </summary> /// <summary> Used to put VMProxyArgs into this context. It separates /// the VMProxyArgs into constant and non-constant types /// pulling out the value of the constant types so they can /// be modified w/o damaging the VMProxyArg, and leaving the /// dynamic ones, as they modify context rather than their own /// state /// </summary> /// <param name="vmpa">VMProxyArg to add /// /// </param> public void AddVMProxyArg(VMProxyArg vmpa) { /* * ask if it's a constant : if so, get the value and put into the * local context, otherwise, put the vmpa in our vmproxyhash */ String key = vmpa.ContextReference; if (vmpa.isConstant()) { localcontext[key] = vmpa.getObject(wrappedContext); } else { vmproxyhash[key] = vmpa; } }
public object Get(string key) { VMProxyArg vMProxyArg = (VMProxyArg)this.vmproxyhash[key]; object obj; if (vMProxyArg != null) { obj = vMProxyArg.getObject(this.wrappedContext); } else if (this.localcontextscope) { obj = this.localcontext[key]; } else { obj = this.localcontext[key]; if (obj == null) { obj = this.innerContext.Get(key); } } return(obj); }