protected override IAsyncResult OnBeginFind(FindRequestContext findRequestContext, AsyncCallback callback, object state) { // FIXME: this is a workaround for (similar to) bug #633945. switch (Environment.OSVersion.Platform) { case PlatformID.Unix: case PlatformID.MacOSX: if (find_delegate == null) { find_delegate = new Action <FindRequestContext> (Find); } return(find_delegate.BeginInvoke(findRequestContext, callback, state)); default: Find(findRequestContext); var result = new TempAsyncResult(null, state); if (callback != null) { callback(result); } return(result); } }
protected override IAsyncResult OnBeginResolve(ResolveCriteria resolveCriteria, AsyncCallback callback, object state) { // FIXME: this is a workaround for (similar to) bug #633945. switch (Environment.OSVersion.Platform) { case PlatformID.Unix: case PlatformID.MacOSX: if (resolve_delegate == null) { resolve_delegate = new Func <ResolveCriteria, EndpointDiscoveryMetadata> (Resolve); } return(resolve_delegate.BeginInvoke(resolveCriteria, callback, state)); default: var ret = Resolve(resolveCriteria); var result = new TempAsyncResult(ret, state); if (callback != null) { callback(result); } return(result); } }