internal Oleaut32.IExtender GetProxyForControl(Control ctl) { Oleaut32.IExtender rval = null; if (proxyCache is null) { proxyCache = new Hashtable(); } else { rval = (Oleaut32.IExtender)proxyCache[ctl]; } if (rval is null) { if (ctl != parent && !GetControlBelongs(ctl)) { Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "!parent || !belongs NYI"); AxContainer c = FindContainerForControl(ctl); if (c is not null) { rval = new ExtenderProxy(ctl, c); } else { Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "unable to find proxy, returning null"); return(null); } } else { rval = new ExtenderProxy(ctl, this); } proxyCache.Add(ctl, rval); } Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "found proxy " + rval.ToString()); return(rval); }
internal Oleaut32.IExtender GetProxyForControl(Control ctl) { Oleaut32.IExtender rval = null; if (_proxyCache is null) { _proxyCache = new(); } else { _proxyCache.TryGetValue(ctl, out rval); } if (rval is null) { if (ctl != _parent && !GetControlBelongs(ctl)) { Debug.WriteLineIf(s_axHTraceSwitch.TraceVerbose, "!parent || !belongs NYI"); AxContainer c = FindContainerForControl(ctl); if (c is not null) { rval = new ExtenderProxy(ctl, c); } else { Debug.WriteLineIf(s_axHTraceSwitch.TraceVerbose, "unable to find proxy, returning null"); return(null); } } else { rval = new ExtenderProxy(ctl, this); } _proxyCache.Add(ctl, rval); } Debug.WriteLineIf(s_axHTraceSwitch.TraceVerbose, $"found proxy {rval}"); return(rval); }