// --------------------------------------------------------------------
        protected void _parseImages(XmlNode root, XmlNamespaceManager nsmgr)
        {
            string imageNamespaceUri =
                "http://schemas.microsoft.com/LiveSearch/2008/04/XML/multimedia";

            nsmgr.AddNamespace("mms", imageNamespaceUri);

            XmlNode     image   = root.SelectSingleNode("./mms:Image", nsmgr);
            XmlNodeList results = image.SelectNodes(
                "./mms:Results/mms:ImageResult",
                nsmgr);

            foreach (XmlNode result in results)
            {
                SearchEngineEventArgs evtArgs = new SearchEngineEventArgs();
                evtArgs.ImageURL     = result.SelectSingleNode("./mms:MediaUrl", nsmgr).InnerText;
                evtArgs.Title        = result.SelectSingleNode("./mms:Title", nsmgr).InnerText;
                evtArgs.ThumbnailURL = result.SelectSingleNode("./mms:Thumbnail/mms:Url", nsmgr).InnerText;

                if (NewImageEvent != null)
                {
                    NewImageEvent(this, evtArgs);
                }
            }
        }
Beispiel #2
0
        private void OnImageFound(object source, SearchEngineEventArgs arg)
        {
            if (this.InvokeRequired)
            {
                int   id  = onlineStorage.Add(arg.ImageURL, arg.Title);
                Image img = imageUtils.retreiveImage(arg.ThumbnailURL);

                this.Invoke(new _ImageFoundDelegate(OnImageFoundDelegate), new object[] { img, id });
            }
        }