The Gallery Feeds get their title from the feed

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-07-23 18:11:54 -07:00
parent 89495ef6cf
commit ec4a444537
5 changed files with 28 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.ServiceModel.Syndication;
@@ -14,7 +15,8 @@ namespace PackageIndexReferenceImplementation.Services {
var formatter = new Atom10FeedFormatter<SyndicationFeed>();
var feedPath = HostingEnvironment.MapPath("~/App_Data/Feed.xml");
if (!File.Exists(feedPath)) {
return new SyndicationFeed();
string title = ConfigurationManager.AppSettings["Title"];
return new SyndicationFeed() { Title = new TextSyndicationContent(title)};
}
using (var reader = XmlReader.Create(feedPath)) {
formatter.ReadFrom(reader);

View File

@@ -12,9 +12,11 @@
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="Title" value="Orchard Modules Gallery"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />