/// <summary> /// Raises the <see cref="MyCustomRssFeed.Loaded"/> event. /// </summary> /// <param name="e">A <see cref="SyndicationResourceLoadedEventArgs"/> that contains the event data.</param> protected virtual void OnFeedLoaded(SyndicationResourceLoadedEventArgs e) { EventHandler <SyndicationResourceLoadedEventArgs> handler = null; handler = this.Loaded; if (handler != null) { handler(this, e); } }
/// <summary> /// Handles the <see cref="ApmlDocument.Loaded"/> event. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">A <see cref="SyndicationResourceLoadedEventArgs"/> that contains event data.</param> private static void ResourceLoadedCallback(Object sender, SyndicationResourceLoadedEventArgs e) { if (e.State != null) { } }
/// <summary> /// Loads the syndication resource using the specified <see cref="XPathNavigator"/> and <see cref="SyndicationResourceLoadSettings"/>. /// </summary> /// <param name="navigator">A read-only <see cref="XPathNavigator"/> object for navigating through the syndication resource information.</param> /// <param name="settings">The <see cref="SyndicationResourceLoadSettings"/> object used to configure the load operation of the <see cref="MyCustomRssFeed"/>.</param> /// <param name="eventData">A <see cref="SyndicationResourceLoadedEventArgs"/> that contains the event data used when raising the <see cref="MyCustomRssFeed.Loaded"/> event.</param> /// <remarks> /// After the load operation has successfully completed, the <see cref="MyCustomRssFeed.Loaded"/> event is raised using the specified <paramref name="eventData"/>. /// </remarks> /// <exception cref="ArgumentNullException">The <paramref name="navigator"/> is a null reference (Nothing in Visual Basic).</exception> /// <exception cref="ArgumentNullException">The <paramref name="settings"/> is a null reference (Nothing in Visual Basic).</exception> /// <exception cref="ArgumentNullException">The <paramref name="eventData"/> is a null reference (Nothing in Visual Basic).</exception> /// <exception cref="FormatException">The <paramref name="navigator"/> data does not conform to the expected syndication content format. In this case, the feed remains empty.</exception> private void Load(XPathNavigator navigator, SyndicationResourceLoadSettings settings, SyndicationResourceLoadedEventArgs eventData) { Guard.ArgumentNotNull(navigator, "navigator"); Guard.ArgumentNotNull(settings, "settings"); Guard.ArgumentNotNull(eventData, "eventData"); // Code to load the syndication resource using the XPathNavigator would go here. // If you support legacy formats, you would use a SyndicationResourceAdapter to fill the feed; // otherwise you would utilize the feed's Load method. this.OnFeedLoaded(eventData); }