Skip to content

Instantly share code, notes, and snippets.

@ArveSystad
Created January 11, 2016 14:45
Show Gist options
  • Save ArveSystad/6846651c59c94d8288b3 to your computer and use it in GitHub Desktop.
Save ArveSystad/6846651c59c94d8288b3 to your computer and use it in GitHub Desktop.
public class CustomFeed : IFeed
{
public string EditViewFriendlyTitle { get { return "Friendly title"; } }
public bool AvailableInEditView { get { return true; } }
public IEnumerable<IFeedItem> LoadItems()
{
var selectItems = new List<IFeedItem>();
selectItems.Add(new FeedItem { Key = "Foo", Value = "1" });
selectItems.Add(new FeedItem { Key = "Bar", Value = "2" });
selectItems.Add(new FeedItem { Key = "Baz", Value = "3" });
return selectItems;
}
// Required for this to work. Seems to be used to identify the feed on the saved form.
// If this changes, your dropdown loses it's possible values.
public string ID
{
get { return "9BC5243C-AC09-4E67-AAAB-78D111F57AF8"; }
set { }
}
public string Description
{
get { return "My custom data source"; }
set { }
}
public Type ProviderType
{
get { return typeof(CustomFeedProvider); }
set { }
}
public string Url { get; set; }
public string ProviderKey { get; set; }
public string ProviderSecret { get; set; }
public string KeyXPath { get; set; }
public string ValueXPath { get; set; }
public int CacheTimeout { get; set; }
public string ExtraConfiguration { get; set; }
public IFeedProvider AssociatedProvider { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment