I've updated the OpenNETCF.Rss library I posted about last time. The IFeedStorage interface has been added. It exposes the following methods:
public interface IFeedStorage
{
///
/// Inits the storage provider.
///
/// Represents a single node in the XML document
void Init(XmlNode section);
///
/// Adds an element with the specified key and value into the storage.
///
void Add (Feed feed);
///
/// Removes all elements from the storage.
///
void Flush ();
///
/// Gets the element with the specified key.
///
Feed GetFeed (string key);
///
/// Removes the element with the specified key.
///
void Remove (string key);
///
/// Updates the element with the specified key.
///
void Update (Feed feed);
///
/// Gets the number of elements actually contained in the storage.
///
int Size{ get; }
}
I've also created the FeedFileStorage class, that inherits from IFeedStorage and implements the functionality to store RSS feeds in the file system. You can provide your own implementaion of the IFeedStorage that could store feeds in the database or in some other location. The FeedEngine class now has the Storage property:
public
static IFeedStorage Storage
It will return the currently enabled feed storage which is dynamically loaded from the config file settings:
<storage>
<provider name="fileStorage" enabled="true" type="OpenNETCF.Rss.FeedFileStorage,OpenNETCF.Rss,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null">
<path value="C:\Temp\Channels" />
<feedSizeLimit value="100" />
</provider>
< SPAN>storage>
So in order to load your own feed storage you'd need to add a similar section to the config file and modify the enabled flag appropriately. The path and feedSizeLimit settings are specific to the file storage. You can provide your own parameters and load them in the IFeedStorage.Init method.
Here's the updated version of the library as well as test clients:
OpenNETCF.Rss1.zip (425.74 KB)