internal static CfrDomDocument Wrap(IntPtr proxyId) { if (proxyId == IntPtr.Zero) { return(null); } var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache; lock (weakCache) { var cfrObj = (CfrDomDocument)weakCache.Get(proxyId); if (cfrObj == null) { cfrObj = new CfrDomDocument(proxyId); weakCache.Add(proxyId, cfrObj); } return(cfrObj); } }
internal static CfrDomDocument Wrap(RemotePtr remotePtr) { if (remotePtr == RemotePtr.Zero) { return(null); } var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache; lock (weakCache) { var cfrObj = (CfrDomDocument)weakCache.Get(remotePtr.ptr); if (cfrObj == null) { cfrObj = new CfrDomDocument(remotePtr); weakCache.Add(remotePtr.ptr, cfrObj); } return(cfrObj); } }
internal static CfrDomDocument Wrap(IntPtr proxyId) { if(proxyId == IntPtr.Zero) return null; var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache; lock(weakCache) { var cfrObj = (CfrDomDocument)weakCache.Get(proxyId); if(cfrObj == null) { cfrObj = new CfrDomDocument(proxyId); weakCache.Add(proxyId, cfrObj); } return cfrObj; } }