/// <summary> /// Finds a component that implements a given feature, which is a child of /// the root. This will call back on the first match. It will call back /// with null if none are found. /// </summary> /// <param name="featureURI">Feature to look for.</param> /// <param name="handler">Callback to use when finished.</param> /// <param name="state">Context to pass back to caller when complete</param> public void BeginFindServiceWithFeature(string featureURI, DiscoNodeHandler handler, object state) { if (handler == null) { return; // prove I *didn't* call it. :) } FindServiceRequest req = new FindServiceRequest(featureURI, handler); BeginGetItems(Root, new DiscoNodeHandler(req.GotRootItems), state); // hopefully enough to prevent GC. }
/// <summary> /// Finds a component that implements a given feature, which is a child of /// the root. This will call back on the first match. It will call back /// with null if none are found. /// </summary> /// <param name="featureURI">Feature to look for.</param> /// <param name="handler">Callback to use when finished.</param> /// <param name="state">Context to pass back to caller when complete</param> public void BeginFindServiceWithFeature(string featureURI, DiscoNodeHandler handler, object state) { if (handler == null) return; // prove I *didn't* call it. :) FindServiceRequest req = new FindServiceRequest(featureURI, handler); BeginGetItems(Root, new DiscoNodeHandler(req.GotRootItems), state); // hopefully enough to prevent GC. }