| |
From: <sdorman@us...> - 2006-12-17 20:12
|
Revision: 2156
http://svn.sourceforge.net/subtext/?rev=2156&view=rev
Author: sdorman
Date: 2006-12-17 12:12:47 -0800 (Sun, 17 Dec 2006)
Log Message:
-----------
Various FxCop fixes, mostly for Globalization rules.
Modified Paths:
--------------
trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs
trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs
trunk/SubtextSolution/Subtext.Framework/Components/Entry.cs
trunk/SubtextSolution/Subtext.Framework/Components/FeedbackItem.cs
trunk/SubtextSolution/Subtext.Framework/Components/Image.cs
trunk/SubtextSolution/Subtext.Framework/Components/Plugin.cs
trunk/SubtextSolution/Subtext.Framework/Configuration/Config.cs
trunk/SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs
trunk/SubtextSolution/Subtext.Framework/ContentCache.cs
trunk/SubtextSolution/Subtext.Framework/Data/Cacher.cs
trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs
trunk/SubtextSolution/Subtext.Framework/Data/DatabaseObjectProvider.cs
trunk/SubtextSolution/Subtext.Framework/Entries.cs
trunk/SubtextSolution/Subtext.Framework/Exceptions/BlogRequiresSubfolderException.cs
trunk/SubtextSolution/Subtext.Framework/Exceptions.cs
trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs
trunk/SubtextSolution/Subtext.Framework/HostInfo.cs
trunk/SubtextSolution/Subtext.Framework/Images.cs
trunk/SubtextSolution/Subtext.Framework/ImportExport/SubtextBlogMlProvider.cs
trunk/SubtextSolution/Subtext.Framework/ImportManager.cs
trunk/SubtextSolution/Subtext.Framework/NamespaceDocumentation.cs
trunk/SubtextSolution/Subtext.Framework/Plugins/PluginBase.cs
trunk/SubtextSolution/Subtext.Framework/Providers/DotNetOpenMailProvider.cs
trunk/SubtextSolution/Subtext.Framework/Security/SecurityHelper.cs
trunk/SubtextSolution/Subtext.Framework/Security/SubtextMembershipProvider.cs
trunk/SubtextSolution/Subtext.Framework/Security/SubtextRoleProvider.cs
trunk/SubtextSolution/Subtext.Framework/Services/MailToWeblog.cs
trunk/SubtextSolution/Subtext.Framework/Stats.cs
trunk/SubtextSolution/Subtext.Framework/SubText.Framework.csproj
trunk/SubtextSolution/Subtext.Framework/Syndication/AtomHandler.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/BaseAtomWriter.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/BaseRssWriter.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/CommentHandler.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionHelper.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionSettings.cs
trunk/SubtextSolution/Subtext.Framework/Syndication/RssHandler.cs
trunk/SubtextSolution/Subtext.Framework/Text/HtmlHelper.cs
trunk/SubtextSolution/Subtext.Framework/Text/StringHelper.cs
trunk/SubtextSolution/Subtext.Framework/Threading/Semaphore.cs
trunk/SubtextSolution/Subtext.Framework/Threading/TimedLock.cs
trunk/SubtextSolution/Subtext.Framework/Tracking/TrackBackHandler.cs
trunk/SubtextSolution/Subtext.Framework/Tracking/TrackHelpers.cs
trunk/SubtextSolution/Subtext.Framework/Tracking/TrackingUrls.cs
trunk/SubtextSolution/Subtext.Framework/UrlManager/HandlerConfiguration.cs
trunk/SubtextSolution/Subtext.Framework/UrlManager/UrlReWriteHandlerFactory.cs
trunk/SubtextSolution/Subtext.Framework/Util/TimeZones.cs
trunk/SubtextSolution/Subtext.Framework/Util/Transform.cs
trunk/SubtextSolution/Subtext.Framework/Util/WebPathStripper.cs
trunk/SubtextSolution/Subtext.Framework/Web/Handlers/RsdHandler.cs
trunk/SubtextSolution/Subtext.Framework/Web/HttpHelper.cs
trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/AuthenticationModule.cs
trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/BlogRequestModule.cs
trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/InstallationCheckModule.cs
trunk/SubtextSolution/Subtext.Framework/XmlRpc/MetaWeblog.cs
Added Paths:
-----------
trunk/SubtextSolution/Subtext.Framework/Properties/
trunk/SubtextSolution/Subtext.Framework/Properties/GlobalSupssions.cs
trunk/SubtextSolution/Subtext.Framework/Properties/Resources.Designer.cs
trunk/SubtextSolution/Subtext.Framework/Properties/Resources.resx
trunk/SubtextSolution/Subtext.Framework/Tracking/TrackbackResponseCode.cs
Modified: trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/BlogInfo.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -26,6 +26,7 @@ />
using Subtext.Framework.Util;
using Subtext.Framework.Web.HttpModules;
using Subtext.Framework.Components;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -748,7 +749,7 @@ />
if(!String.IsNullOrEmpty(value))
{
if (value.Contains("/") || value.Contains("\\"))
- throw new InvalidOperationException("Cannot specify a feedburner name with invalid characters.");
+ throw new InvalidOperationException(Resources.Format_InvalidFeedburnerName);
}
this.feedBurnerName = value;
}
@@ -775,7 +776,7 @@ />
return this.rootUrl;
}
}
- Uri rootUrl = null;
+ Uri rootUrl;
/// <summary>
/// Gets the virtual URL for the site with ceding and trailing slash. For example, "/" or "/Subtext.Web/" or "/Blog/".
@@ -1003,9 +1004,12 @@ />
/// <returns></returns>
public override bool Equals(object obj)
{
- if(obj == null || GetType() != obj.GetType())
+ if(obj == null)
return false;
+ if (GetType() != obj.GetType())
+ return false;
+
return ((BlogInfo)obj).Id == this.Id;
}
Modified: trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -20,6 +20,7 @@ />
using Subtext.Framework.Configuration;
using Subtext.Framework.Exceptions;
using Subtext.Framework.Security;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -77,6 +78,11 @@ />
/// <param name="feedbackItem">Entry.</param>
public static void FilterAfterPersist(FeedbackItem feedbackItem)
{
+ if (feedbackItem == null)
+ {
+ throw new ArgumentNullException("feedbackItem", Resources.ArgumentNull_Generic);
+ }
+
if (!SecurityHelper.IsAdmin)
{
if (!Config.CurrentBlog.ModerationEnabled)
Modified: trunk/SubtextSolution/Subtext.Framework/Components/Entry.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Components/Entry.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Components/Entry.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -20,6 +20,7 @@ />
using Subtext.Extensibility;
using Subtext.Extensibility.Interfaces;
using Subtext.Framework.Configuration;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Components
{
@@ -439,7 +440,7 @@ />
public static int CalculateChecksum(string text)
{
if(text == null)
- throw new ArgumentNullException("text", "Cannot calculate checksum for null string.");
+ throw new ArgumentNullException("text", Resources.ArgumentNull_String);
int checksum = 0;
foreach(char c in text)
{
Modified: trunk/SubtextSolution/Subtext.Framework/Components/FeedbackItem.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Components/FeedbackItem.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Components/FeedbackItem.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -29,6 +29,7 @@ />
using Subtext.Framework.Threading;
using Subtext.Framework.Web;
using Subtext.Framework.Security;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Components
{
@@ -93,21 +94,26 @@ />
/// <param name="feedback">The feedback.</param>
/// <param name="filter">Spam filter.</param>
/// <returns></returns>
- public static int Create(FeedbackItem feedback, CommentFilter filter)
- {
- if (HttpContext.Current != null && HttpContext.Current.Request != null)
- {
- feedback.UserAgent = HttpContext.Current.Request.UserAgent;
- feedback.IpAddress = HttpHelper.GetUserIpAddress(HttpContext.Current);
- }
-
- feedback.FlaggedAsSpam = true; //We're going to start with this assumption.
- feedback.Author = HtmlHelper.SafeFormat(feedback.Author);
- feedback.Body = HtmlHelper.ConvertToAllowedHtml(feedback.Body);
- feedback.Title = HtmlHelper.SafeFormat(feedback.Title);
-
- // If we are creating this feedback item as part of an import, we want to
- // be sure to use the item's datetime, and not set it to the current time.
+ public static int Create(FeedbackItem feedback, CommentFilter filter)
+ {
+ if (feedback == null)
+ {
+ throw new ArgumentNullException("feedback", Resources.ArgumentNull_Generic);
+ }
+
+ if (HttpContext.Current != null && HttpContext.Current.Request != null)
+ {
+ feedback.UserAgent = HttpContext.Current.Request.UserAgent;
+ feedback.IpAddress = HttpHelper.GetUserIpAddress(HttpContext.Current);
+ }
+
+ feedback.FlaggedAsSpam = true; //We're going to start with this assumption.
+ feedback.Author = HtmlHelper.SafeFormat(feedback.Author);
+ feedback.Body = HtmlHelper.ConvertToAllowedHtml(feedback.Body);
+ feedback.Title = HtmlHelper.SafeFormat(feedback.Title);
+
+ // If we are creating this feedback item as part of an import, we want to
+ // be sure to use the item's datetime, and not set it to the current time.
if (NullValue.NullDateTime.Equals(feedback.DateCreated))
{
feedback.DateCreated = Config.CurrentBlog.TimeZone.Now;
@@ -117,27 +123,26 @@ />
{
feedback.DateModified = feedback.DateCreated;
}
+
+ if (filter != null)
+ filter.FilterBeforePersist(feedback);
-
- if(filter != null)
- filter.FilterBeforePersist(feedback);
-
- feedback.Id = ObjectProvider.Instance().CreateFeedback(feedback);
-
- if(filter != null)
+ feedback.Id = ObjectProvider.Instance().CreateFeedback(feedback);
+
+ if (filter != null)
CommentFilter.FilterAfterPersist(feedback);
- // if it's not the administrator commenting and it's not a trackback.
- if (!SecurityHelper.IsAdmin && !String.IsNullOrEmpty(Config.CurrentBlog.Owner.Email) && feedback.FeedbackType != Extensibility.FeedbackType.PingTrack)
- {
- //In order to make this async, we need to pass the HttpContext.Current
- //several layers deep. Instead, we should create our own context.
- EmailCommentToAdmin(feedback, Config.CurrentBlog);
- }
-
- return feedback.Id;
- }
+ // if it's not the administrator commenting and it's not a trackback.
+ if (!SecurityHelper.IsAdmin && !String.IsNullOrEmpty(Config.CurrentBlog.Owner.Email) && feedback.FeedbackType != Extensibility.FeedbackType.PingTrack)
+ {
+ //In order to make this async, we need to pass the HttpContext.Current
+ //several layers deep. Instead, we should create our own context.
+ EmailCommentToAdmin(feedback, Config.CurrentBlog);
+ }
+ return feedback.Id;
+ }
+
/// <summary>
/// Returns the itemCount most recent active comments.
/// </summary>
@@ -156,7 +161,7 @@ />
public static bool Update(FeedbackItem feedbackItem)
{
if (feedbackItem == null)
- throw new ArgumentNullException("feedbackItem", "Cannot update a null feedback");
+ throw new ArgumentNullException("feedbackItem", Resources.ArgumentNull_Generic);
feedbackItem.DateModified = Config.CurrentBlog.TimeZone.Now;
return ObjectProvider.Instance().Update(feedbackItem);
@@ -221,7 +226,7 @@ />
public static void Approve(FeedbackItem feedback)
{
if (feedback == null)
- throw new ArgumentNullException("comment", "Cannot approve a null comment.");
+ throw new ArgumentNullException("feedback", Resources.ArgumentNull_Generic);
feedback.SetStatus(FeedbackStatusFlag.Approved, true);
feedback.SetStatus(FeedbackStatusFlag.Deleted, false);
@@ -240,7 +245,7 @@ />
public static void ConfirmSpam(FeedbackItem feedback)
{
if (feedback == null)
- throw new ArgumentNullException("comment", "Cannot approve a null comment.");
+ throw new ArgumentNullException("feedback", Resources.ArgumentNull_Generic);
feedback.SetStatus(FeedbackStatusFlag.Approved, false);
feedback.SetStatus(FeedbackStatusFlag.ConfirmedSpam, true);
@@ -260,7 +265,7 @@ />
public static void Delete(FeedbackItem feedback)
{
if (feedback == null)
- throw new ArgumentNullException("comment", "Cannot delete a null comment.");
+ throw new ArgumentNullException("feedback", Resources.ArgumentNull_Generic);
feedback.SetStatus(FeedbackStatusFlag.Approved, false);
feedback.SetStatus(FeedbackStatusFlag.Deleted, true);
@@ -275,10 +280,10 @@ />
public static void Destroy(FeedbackItem feedback)
{
if (feedback == null)
- throw new ArgumentNullException("comment", "Cannot destroy a null comment.");
+ throw new ArgumentNullException("feedback", Resources.ArgumentNull_Generic);
if (feedback.Approved)
- throw new InvalidOperationException("Cannot destroy an approved comment. Please flag it as spam or trash it first.");
+ throw new InvalidOperationException(Resources.InvalidOperation_DestroyApprovedComment);
ObjectProvider.Instance().DestroyFeedback(feedback.Id);
}
@@ -290,7 +295,7 @@ />
public static void Destroy(FeedbackStatusFlag feedbackStatus)
{
if ((feedbackStatus & FeedbackStatusFlag.Approved) == FeedbackStatusFlag.Approved)
- throw new InvalidOperationException("Cannot destroy an active comment.");
+ throw new InvalidOperationException(Resources.InvalidOperation_DestroyActiveComment);
ObjectProvider.Instance().DestroyFeedback(feedbackStatus);
}
@@ -659,7 +664,7 @@ />
public static int CalculateChecksum(string text)
{
if (text == null)
- throw new ArgumentNullException("text", "Cannot calculate checksum for null string.");
+ throw new ArgumentNullException("text", Resources.ArgumentNull_String);
int checksum = 0;
foreach (char c in text)
{
Modified: trunk/SubtextSolution/Subtext.Framework/Components/Image.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Components/Image.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Components/Image.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -68,24 +68,28 @@ />
}
private string _localfile;
- public virtual string LocalFilePath
- {
- get
- {
- if(_localfile == null)
- {
- throw new Exception("Image.LocalFilePath has not been set yet.");
- }
- return _localfile;
- }
- set
- {
- if(value == null)
- {
- _localfile = null;
- }
- _localfile= value.Replace("/","\\");}
- }
+ public virtual string LocalFilePath
+ {
+ get
+ {
+ if (_localfile == null)
+ {
+ throw new Exception("Image.LocalFilePath has not been set yet.");
+ }
+ return _localfile;
+ }
+ set
+ {
+ if (value == null)
+ {
+ _localfile = null;
+ }
+ else
+ {
+ _localfile = value.Replace("/", "\\");
+ }
+ }
+ }
private string _title;
public virtual string Title
Modified: trunk/SubtextSolution/Subtext.Framework/Components/Plugin.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Components/Plugin.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Components/Plugin.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -22,6 +22,7 @@ />
using System.Collections.Specialized;
using System.Web;
using System.Web.Caching;
+using System.Globalization;
namespace Subtext.Framework.Components
{
@@ -74,7 +75,7 @@ />
if (HttpContext.Current.Cache != null)
{
//try to get the object from the cache
- object cachedPluginList = HttpContext.Current.Cache[String.Format(PLUGINCACHENAMEFORMAT, blogId)];
+ object cachedPluginList = HttpContext.Current.Cache[String.Format(CultureInfo.InvariantCulture, PLUGINCACHENAMEFORMAT, blogId)];
pluginList = (IDictionary<Guid, Plugin>)cachedPluginList;
}
//if the pluginlist is still null (not found inside the cache) go and hit the DB
@@ -186,13 +187,13 @@ />
private static void StorePluginListToCache(IDictionary<Guid, Plugin> pluginList)
{
int blogId = Subtext.Framework.Configuration.Config.CurrentBlog.Id;
- HttpContext.Current.Cache.Insert(String.Format(PLUGINCACHENAMEFORMAT, blogId), pluginList, null, Cache.NoAbsoluteExpiration, new TimeSpan(1, 0, 0), CacheItemPriority.NotRemovable, null);
+ HttpContext.Current.Cache.Insert(String.Format(CultureInfo.InvariantCulture, PLUGINCACHENAMEFORMAT, blogId), pluginList, null, Cache.NoAbsoluteExpiration, new TimeSpan(1, 0, 0), CacheItemPriority.NotRemovable, null);
}
private static void RemovePluginListFromCache()
{
int blogId = Subtext.Framework.Configuration.Config.CurrentBlog.Id;
- HttpContext.Current.Cache.Remove(String.Format(PLUGINCACHENAMEFORMAT, blogId));
+ HttpContext.Current.Cache.Remove(String.Format(CultureInfo.InvariantCulture, PLUGINCACHENAMEFORMAT, blogId));
}
#endregion Cache managing helper classes
Modified: trunk/SubtextSolution/Subtext.Framework/Configuration/Config.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Configuration/Config.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Configuration/Config.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -320,7 +320,7 @@ />
public static bool IsValidSubfolderName(string subfolder)
{
if(subfolder == null)
- throw new ArgumentNullException("Subfolder cannot be null.");
+ throw new ArgumentNullException("subfolder", "Subfolder cannot be null.");
if(subfolder.StartsWith(".") || subfolder.EndsWith("."))
return false;
Modified: trunk/SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Configuration/UrlBasedBlogInfoProvider.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -24,6 +24,7 @@ />
using Subtext.Framework.Exceptions;
using Subtext.Framework.Logging;
using Subtext.Framework.Web.HttpModules;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Configuration
{
@@ -215,6 +216,11 @@ />
/// <returns></returns>
static protected string GetCurrentHost(HttpRequest Request)
{
+ if (Request == null)
+ {
+ throw new ArgumentNullException("Request", Resources.ArgumentNull_Generic);
+ }
+
string host = Request.Url.Host;
if(!Request.Url.IsDefaultPort)
{
@@ -240,6 +246,26 @@ />
/// <param name="cacheKEY">Cache KEY.</param>
protected void CacheConfig(Cache cache, BlogInfo info, string cacheKEY)
{
+ if (cache == null)
+ {
+ throw new ArgumentNullException("cache", Resources.ArgumentNull_Generic);
+ }
+
+ if (info == null)
+ {
+ throw new ArgumentNullException("info", Resources.ArgumentNull_Generic);
+ }
+
+ if (cacheKEY == null)
+ {
+ throw new ArgumentNullException("cacheKEY", Resources.ArgumentNull_Generic);
+ }
+
+ if (cacheKEY.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "cacheKEY");
+ }
+
cache.Insert(cacheKEY, info, null, DateTime.Now.AddSeconds(CacheTime), TimeSpan.Zero, CacheItemPriority.High, null);
}
}
Modified: trunk/SubtextSolution/Subtext.Framework/ContentCache.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/ContentCache.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/ContentCache.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -4,6 +4,7 @@ />
using System.Threading;
using System.Web;
using System.Web.Caching;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -76,7 +77,7 @@ />
public void Insert(string key, object value)
{
if(value == null)
- throw new ArgumentNullException("value", "Cannot cache a null object.");
+ throw new ArgumentNullException("value", Resources.ArgumentNull_Generic);
this.cache.Insert(GetCacheKey(key), value);
}
@@ -95,7 +96,7 @@ />
public void Insert(string key, object value, CacheDuration cacheDuration)
{
if(value == null)
- throw new ArgumentNullException("value", "Cannot cache a null object.");
+ throw new ArgumentNullException("value", Resources.ArgumentNull_Generic);
this.cache.Insert(GetCacheKey(key), value, null, DateTime.Now.AddSeconds((int)cacheDuration), TimeSpan.Zero, CacheItemPriority.Normal, null);
}
@@ -115,7 +116,7 @@ />
public void Insert(string key, object value, CacheDependency cacheDependency)
{
if(value == null)
- throw new ArgumentNullException("value", "Cannot cache a null object.");
+ throw new ArgumentNullException("value", Resources.ArgumentNull_Generic);
this.cache.Insert(GetCacheKey(key), value, cacheDependency);
}
Modified: trunk/SubtextSolution/Subtext.Framework/Data/Cacher.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Data/Cacher.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Data/Cacher.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -45,7 +45,7 @@ />
/// <returns></returns>
public static ICollection<LinkCategory> GetActiveCategories(CacheDuration cacheDuration)
{
- string key = string.Format(ActiveLCCKey, Config.CurrentBlog.Id);
+ string key = string.Format(CultureInfo.InvariantCulture, ActiveLCCKey, Config.CurrentBlog.Id);
ContentCache cache = ContentCache.Instantiate();
@@ -123,7 +123,7 @@ />
private static readonly string ECKey="EC:Count{0}Category{1}BlogId{2}";
public static IList<Entry> GetEntriesByCategory(int count, CacheDuration cacheDuration, int categoryID)
{
- string key = string.Format(ECKey, count, categoryID, Config.CurrentBlog.Id);
+ string key = String.Format(CultureInfo.InvariantCulture, ECKey, count, categoryID, Config.CurrentBlog.Id);
ContentCache cache = ContentCache.Instantiate();
IList<Entry> ec = (IList<Entry>)cache[key];
if(ec == null)
@@ -147,7 +147,7 @@ />
string categoryName = Path.GetFileNameWithoutExtension(path);
if(StringHelper.IsNumeric(categoryName))
{
- int categoryID = Int32.Parse(categoryName);
+ int categoryID = Int32.Parse(categoryName, NumberFormatInfo.InvariantInfo);
return SingleCategory(cacheDuration, categoryID);
}
else
@@ -161,7 +161,7 @@ />
public static LinkCategory SingleCategory(CacheDuration cacheDuration, int categoryID)
{
ContentCache cache = ContentCache.Instantiate();
- string key = string.Format(LCKey, categoryID, Config.CurrentBlog.Id);
+ string key = String.Format(CultureInfo.InvariantCulture, LCKey, categoryID, Config.CurrentBlog.Id);
LinkCategory lc = (LinkCategory)cache[key];
if(lc == null)
{
@@ -174,7 +174,7 @@ />
public static LinkCategory SingleCategory(CacheDuration cacheDuration, string categoryName)
{
ContentCache cache = ContentCache.Instantiate();
- string key = string.Format(LCKey, categoryName, Config.CurrentBlog.Id);
+ string key = String.Format(CultureInfo.InvariantCulture, LCKey, categoryName, Config.CurrentBlog.Id);
LinkCategory lc = (LinkCategory)cache[key];
if(lc == null)
{
@@ -194,7 +194,7 @@ />
if(StringHelper.IsNumeric(id))
{
- return GetEntry(Int32.Parse(id), cacheDuration);
+ return GetEntry(Int32.Parse(id, NumberFormatInfo.InvariantInfo), cacheDuration);
}
else
{
@@ -218,7 +218,7 @@ />
int blogId = Config.CurrentBlog.Id;
ContentCache cache = ContentCache.Instantiate();
- string key = string.Format(EntryKeyName, EntryName, blogId);
+ string key = string.Format(CultureInfo.InvariantCulture, EntryKeyName, EntryName, blogId);
Entry entry = (Entry)cache[key];
if(entry == null)
@@ -230,7 +230,7 @@ />
//Most other page items will use the entryID. Add entry to cache for id key as well.
//Bind them together with a cache dependency.
- string entryIDKey = string.Format(EntryKeyID, entry.Id, blogId);
+ string entryIDKey = String.Format(CultureInfo.InvariantCulture, EntryKeyID, entry.Id, blogId);
CacheDependency cd = new CacheDependency(null, new string[]{key});
cache.Insert(entryIDKey, entry, cd);
@@ -250,7 +250,7 @@ />
public static Entry GetEntry(int entryID, CacheDuration cacheDuration)
{
ContentCache cache = ContentCache.Instantiate();
- string key = string.Format(EntryKeyID, entryID, Config.CurrentBlog.Id);
+ string key = String.Format(CultureInfo.InvariantCulture, EntryKeyID, entryID, Config.CurrentBlog.Id);
Entry entry = (Entry)cache[key];
if(entry == null)
@@ -273,7 +273,7 @@ />
/// <param name="entryID">The entry ID.</param>
public static void ClearCommentCache(int entryID)
{
- string key = string.Format(ParentCommentEntryKey, entryID, Config.CurrentBlog.Id);
+ string key = String.Format(CultureInfo.InvariantCulture, ParentCommentEntryKey, entryID, Config.CurrentBlog.Id);
ContentCache cache = ContentCache.Instantiate();
cache.Remove(key);
}
@@ -293,7 +293,7 @@ />
string key = null;
if (fromCache)
{
- key = string.Format(ParentCommentEntryKey, parentEntry.Id, Config.CurrentBlog.Id);
+ key = String.Format(CultureInfo.InvariantCulture, ParentCommentEntryKey, parentEntry.Id, Config.CurrentBlog.Id);
cache = ContentCache.Instantiate();
comments = (IList<FeedbackItem>)cache[key];
}
Modified: trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Data/DataHelper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -1123,6 +1123,7 @@ />
//create the DataAdapter & DataTable
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
+ dt.Locale = CultureInfo.InvariantCulture;
//fill the DataTable using default values for DataTable names, etc.
da.Fill(dt);
@@ -1174,6 +1175,7 @@ />
//create the DataAdapter & DataTable
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
+ dt.Locale = CultureInfo.InvariantCulture;
//fill the DataTable using default values for DataTable names, etc.
da.Fill(dt);
Modified: trunk/SubtextSolution/Subtext.Framework/Data/DatabaseObjectProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Data/DatabaseObjectProvider.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Data/DatabaseObjectProvider.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -31,6 +31,7 @@ />
using Subtext.Framework.Providers;
using Subtext.Framework.Text;
using Subtext.Framework.Util;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Data
{
@@ -655,7 +656,7 @@ />
public override int CreateFeedback(FeedbackItem feedbackItem)
{
if (feedbackItem == null)
- throw new ArgumentNullException("feedbackItem", "Cannot insert a null feedback item.");
+ throw new ArgumentNullException("feedbackItem", Resources.ArgumentNull_Generic);
string ipAddress = null;
if (feedbackItem.IpAddress != null)
@@ -734,7 +735,7 @@ />
public override int InsertEntry(Entry entry)
{
if (entry == null)
- throw new ArgumentNullException("link", "Cannot insert a null entry.");
+ throw new ArgumentNullException("link", Resources.ArgumentNull_Generic);
SqlParameter outIdParam = DataHelper.MakeOutParam("@ID", SqlDbType.Int, 4);
@@ -865,11 +866,16 @@ />
public override bool SetEntryCategoryList(int entryId, int[] categoryIds)
{
- if (categoryIds == null || categoryIds.Length == 0)
+ if (categoryIds == null)
{
return false;
}
+ if (categoryIds.Length == 0)
+ {
+ return false;
+ }
+
string[] cats = new string[categoryIds.Length];
for (int i = 0; i < categoryIds.Length; i++)
{
@@ -1168,7 +1174,7 @@ />
public override int CreateLink(Link link)
{
if (link == null)
- throw new ArgumentNullException("link", "Cannot insert a null link.");
+ throw new ArgumentNullException("link", Resources.ArgumentNull_Generic);
SqlParameter outParam = DataHelper.MakeOutParam("@LinkID", SqlDbType.Int, 4);
SqlParameter[] p =
@@ -1189,6 +1195,11 @@ />
public override bool UpdateLinkCategory(LinkCategory category)
{
+ if (category == null)
+ {
+ throw new ArgumentNullException("category", Resources.ArgumentNull_Generic);
+ }
+
SqlParameter[] p =
{
@@ -1205,7 +1216,7 @@ />
public override int CreateLinkCategory(LinkCategory category)
{
if (category == null)
- throw new ArgumentNullException("category", "Cannot insert a null category.");
+ throw new ArgumentNullException("category", Resources.ArgumentNull_Generic);
SqlParameter outParam = DataHelper.MakeOutParam("@CategoryID", SqlDbType.Int, 4);
SqlParameter[] p =
@@ -1586,7 +1597,7 @@ />
public override int InsertKeyWord(KeyWord keyWord)
{
if (keyWord == null)
- throw new ArgumentNullException("keyword", "Cannot insert a null keyword.");
+ throw new ArgumentNullException("keyword", Resources.ArgumentNull_Generic);
SqlParameter outParam = DataHelper.MakeOutParam("@KeyWordID", SqlDbType.Int, 4);
SqlParameter[] p =
@@ -1678,7 +1689,7 @@ />
public override int InsertImage(Image image)
{
if (image == null)
- throw new ArgumentNullException("image", "Cannot insert a null image.");
+ throw new ArgumentNullException("image", Resources.ArgumentNull_Generic);
SqlParameter outParam = DataHelper.MakeOutParam("@ImageID", SqlDbType.Int, 4);
SqlParameter[] p =
Modified: trunk/SubtextSolution/Subtext.Framework/Entries.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Entries.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Entries.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -31,6 +31,8 @@ />
using Subtext.Framework.Providers;
using Subtext.Framework.Text;
using Subtext.Framework.Tracking;
+using System.Globalization;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -213,8 +215,13 @@ />
/// <returns></returns>
public static int Create(Entry entry)
{
- Debug.Assert(entry.PostType != PostType.None, "Posttype should never be null.");
+ if (entry == null)
+ {
+ throw new ArgumentNullException("entry", Resources.ArgumentNull_Generic);
+ }
+ Debug.Assert(entry.PostType != PostType.None, "Posttype should never be null.");
+
if (Config.CurrentBlog.AutoFriendlyUrlEnabled
&& String.IsNullOrEmpty(entry.EntryName)
&& !String.IsNullOrEmpty(entry.Title))
@@ -271,8 +278,11 @@ />
public static string AutoGenerateFriendlyUrl(string title)
{
if (title == null)
- throw new ArgumentNullException("title", "Cannot generate friendly url from null title.");
+ throw new ArgumentNullException("title", Resources.ArgumentNull_String);
+ if (title.Length == 0)
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "title");
+
NameValueCollection friendlyUrlSettings = (NameValueCollection)ConfigurationManager.GetSection("FriendlyUrlSettings");
if (friendlyUrlSettings == null)
{
@@ -289,7 +299,7 @@ />
}
else
{
- wordCount = int.Parse(friendlyUrlSettings["limitWordCount"]);
+ wordCount = Int32.Parse(friendlyUrlSettings["limitWordCount"], NumberFormatInfo.InvariantInfo);
}
// break down to number of words. If 0 (or less) don't mess with the title
@@ -334,9 +344,12 @@ />
/// <returns></returns>
public static string AutoGenerateFriendlyUrl(string title, char wordSeparator)
{
- if (title == null)
- throw new ArgumentNullException("title", "Cannot generate friendly url from null title.");
+ if (title == null)
+ throw new ArgumentNullException("title", Resources.ArgumentNull_String);
+ if (title.Length == 0)
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "title");
+
string entryName = RemoveNonWordCharacters(title);
entryName = ReplaceSpacesWithSeparator(entryName, wordSeparator);
entryName = HttpUtility.UrlEncode(entryName);
@@ -426,6 +439,11 @@ />
/// <returns></returns>
public static bool Update(Entry entry)
{
+ if (entry == null)
+ {
+ throw new ArgumentNullException("entry", Resources.ArgumentNull_Generic);
+ }
+
if (NullValue.IsNull(entry.DateSyndicated) && entry.IsActive && entry.IncludeInMainSyndication)
{
entry.DateSyndicated = Config.CurrentBlog.TimeZone.Now;
@@ -448,7 +466,12 @@ />
/// <returns></returns>
public static bool Update(Entry entry, params int[] categoryIDs)
{
- entry.DateModified = Config.CurrentBlog.TimeZone.Now;
+ if (entry == null)
+ {
+ throw new ArgumentNullException("entry", Resources.ArgumentNull_Generic);
+ }
+
+ entry.DateModified = Config.CurrentBlog.TimeZone.Now;
return ObjectProvider.Instance().Update(entry, categoryIDs);
}
Modified: trunk/SubtextSolution/Subtext.Framework/Exceptions/BlogRequiresSubfolderException.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Exceptions/BlogRequiresSubfolderException.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Exceptions/BlogRequiresSubfolderException.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -14,6 +14,8 @@ />
#endregion
using System;
+using Subtext.Framework.Properties;
+using System.Globalization;
namespace Subtext.Framework.Exceptions
{
@@ -82,11 +84,11 @@ />
{
get
{
- string blogCountClause = "is another blog";
+ string blogCountClause = Resources.IsAnotherBlog;
if(_blogsWithSameHostCount >= 1)
- blogCountClause = "are " + _blogsWithSameHostCount + " blogs";
+ blogCountClause = String.Format(CultureInfo.CurrentUICulture, Resources.AreBlogs, _blogsWithSameHostCount);
- return String.Format("Sorry, but there {0} with the specified hostname '{1}'. To set up another blog with the same hostname, you must provide an subfolder name. Please click on 'Host Domain' below for more information.", blogCountClause, _host);
+ return String.Format(CultureInfo.CurrentUICulture, Resources.BlogRequiresSubfolder_Generic, blogCountClause, _host);
}
}
Modified: trunk/SubtextSolution/Subtext.Framework/Exceptions.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Exceptions.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Exceptions.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -14,6 +14,7 @@ />
#endregion
using System;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -44,7 +45,7 @@ />
public class ExtendedPropertiesOverFlowException : Exception
{
- public ExtendedPropertiesOverFlowException() : base("ExtendedProperties bytes overflow. The ExtendedProperties is limited to 7800 bytes")
+ public ExtendedPropertiesOverFlowException() : base(Resources.ExtendedPropertiesOverflow_Generic)
{
}
Modified: trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -22,6 +22,7 @@ />
using Subtext.Extensibility;
using Subtext.Framework.Components;
using Subtext.Framework.Configuration;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Format
{
@@ -113,6 +114,11 @@ />
public virtual string EntryFullyQualifiedUrl(Entry entry)
{
+ if (entry == null)
+ {
+ throw new ArgumentNullException("entry", Resources.ArgumentNull_Generic);
+ }
+
return EntryFullyQualifiedUrl(entry.DateCreated, entry.EntryName, entry.Id);
}
@@ -255,7 +261,7 @@ />
case 6:
return DateTime.ParseExact(date,"MMyyyy", en);
default:
- throw new Exception("Invalid Date Format");
+ throw new Exception(Resources.Format_BadDateTime);
}
}
@@ -278,12 +284,12 @@ />
{
try
{
- return Int32.Parse(GetRequestedFileName(uri));
+ return Int32.Parse(GetRequestedFileName(uri), NumberFormatInfo.InvariantInfo);
}
catch (FormatException)
{
- throw new ArgumentException("Invalid Post ID.");
- }
+ throw new ArgumentException(Resources.Format_InvalidPostId);
+ }
}
/// <summary>
@@ -308,12 +314,26 @@ />
/// <returns></returns>
public static string GetBlogSubfolderFromRequest(string rawUrl, string applicationPath)
{
- if(rawUrl == null)
- throw new ArgumentNullException("path", "The path cannot be null.");
+ if (rawUrl == null)
+ {
+ throw new ArgumentNullException("rawUrl", Resources.ArgumentNull_String);
+ }
- if(applicationPath == null)
- throw new ArgumentNullException("app", "The app should not be null.");
+ if (applicationPath == null)
+ {
+ throw new ArgumentNullException("applicationPath", Resources.ArgumentNull_Path);
+ }
+ if (rawUrl.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "rawUrl");
+ }
+
+ if (applicationPath.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "applicationPath");
+ }
+
// The {0} resents a potential virtual directory
string urlPatternFormat = "{0}/(?<app>.*?)/";
@@ -372,6 +392,11 @@ />
/// <returns></returns>
public static string GetEditLink(Entry entry)
{
+ if (entry == null)
+ {
+ throw new ArgumentNullException("entry", Resources.ArgumentNull_Generic);
+ }
+
//This is too small a concatenation to create a
//the overhead of a StringBuilder. If perf is really a hit here,
//we can pass in a string builder.
@@ -445,19 +470,29 @@ />
/// </summary>
/// <param name="target">The target.</param>
/// <returns></returns>
- public static string StripSurroundingSlashes(string target)
- {
- if(target == null)
- throw new ArgumentNullException("target", "The target to strip slashes from is null.");
+ public static string StripSurroundingSlashes(string target)
+ {
+ if (target == null)
+ {
+ throw new ArgumentNullException("target", Resources.ArgumentNull_String);
+ }
- if(target.EndsWith("/"))
- target = target.Remove(target.Length - 1, 1);
- if(target.StartsWith("/"))
- target = target.Remove(0, 1);
+ if (target.Length != 0)
+ {
+ if (target.EndsWith("/"))
+ {
+ target = target.Remove(target.Length - 1, 1);
+ }
- return target;
- }
+ if (target.StartsWith("/"))
+ {
+ target = target.Remove(0, 1);
+ }
+ }
+ return target;
+ }
+
/// <summary>
/// Get the fully qualified url for an image for a given url to the image.
/// The given url could be fully qualified, or some type of local url.
@@ -484,7 +519,7 @@ />
// it's not a full url, so it must by some type of local url
// so add the siteRoot in front of it.
imageUrl = StripSurroundingSlashes(imageUrl);
- imageUrl = string.Format("" target="_blank">http://{0}/{1}", Config.CurrentBlog.Host, imageUrl) ;
+ imageUrl = string.Format(CultureInfo.InvariantCulture, "" target="_blank">http://{0}/{1}", Config.CurrentBlog.Host, imageUrl) ;
}
return imageUrl ;
}
@@ -496,7 +531,7 @@ />
/// <returns></returns>
public static string StripHostFromUrl(string url)
{
- string fullHost = string.Format("{0}://{1}", HttpContext.Current.Request.Url.Scheme, Config.CurrentBlog.Host);
+ string fullHost = string.Format(CultureInfo.InvariantCulture, "{0}://{1}", HttpContext.Current.Request.Url.Scheme, Config.CurrentBlog.Host);
if(url.StartsWith(fullHost))
{
Modified: trunk/SubtextSolution/Subtext.Framework/HostInfo.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/HostInfo.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/HostInfo.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -19,6 +19,7 @@ />
using Subtext.Framework.Exceptions;
using Subtext.Framework.Providers;
using Subtext.Framework.Security;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -147,7 +148,7 @@ />
public static bool CreateHost(string hostUserName, string hostPassword, string email)
{
if(!InstallationManager.HostInfoRecordNeeded)
- throw new InvalidOperationException("Cannot create a Host record. One already exists.");
+ throw new InvalidOperationException(Resources.InvalidOperation_HostRecordExists);
HostInfo host = new HostInfo();
@@ -178,7 +179,32 @@ />
/// <param name="newPassword">The new password.</param>
public static void ChangePassword(HostInfo host, string oldPassword, string newPassword)
{
- //Make sure we can grab the host admin.
+ if (host == null)
+ {
+ throw new ArgumentNullException("host", Resources.ArgumentNull_Generic);
+ }
+
+ if (oldPassword == null)
+ {
+ throw new ArgumentNullException("oldPassword", Resources.ArgumentNull_String);
+ }
+
+ if (newPassword == null)
+ {
+ throw new ArgumentNullException("newPassword", Resources.ArgumentNull_String);
+ }
+
+ if (oldPassword.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "oldPassword");
+ }
+
+ if (newPassword.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "newPassword");
+ }
+
+ //Make sure we can grab the host admin.
using (MembershipApplicationScope.SetApplicationName("/"))
{
Membership.Provider.ChangePassword(host.Owner.UserName, oldPassword, newPassword);
Modified: trunk/SubtextSolution/Subtext.Framework/Images.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Images.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Images.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -25,6 +25,7 @@ />
using Subtext.Framework.Configuration;
using Subtext.Framework.Providers;
using Image = Subtext.Framework.Components.Image;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -116,7 +117,21 @@ />
public static bool SaveImage(byte[] Buffer, string FileName)
{
-
+ if (Buffer == null)
+ {
+ throw new ArgumentNullException("Buffer", Resources.ArgumentNull_Array);
+ }
+
+ if (FileName == null)
+ {
+ throw new ArgumentNullException("FileName", Resources.ArgumentNull_Generic);
+ }
+
+ if (FileName.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "FileName");
+ }
+
if (ValidateFile(FileName))
{
CheckDirectory(FileName);
@@ -134,6 +149,11 @@ />
/// <param name="image">Original image to process.</param>
public static void MakeAlbumImages(Subtext.Framework.Components.Image image)
{
+ if (image == null)
+ {
+ throw new ArgumentNullException("image", Resources.ArgumentNull_Generic);
+ }
+
System.Drawing.Image originalImage = System.Drawing.Image.FromFile(image.OriginalFilePath);
// Need to load the original image to manipulate. But indexed GIFs can cause issues.
@@ -194,6 +214,13 @@ />
public static string GetFileName(string filepath)
{
+ if (filepath == null)
+ throw new ArgumentNullException("filepath", Resources.ArgumentNull_String);
+
+ if (filepath.Length == 0)
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "filepath");
+
+
if(filepath.IndexOf("\\") == -1)
{
return StripUrlCharsFromFileName(filepath);
@@ -218,7 +245,17 @@ />
public static void CheckDirectory(string filepath)
{
- string dir = filepath.Substring(0,filepath.LastIndexOf("\\"));
+ if (filepath == null)
+ {
+ throw new ArgumentNullException("filepath", Resources.ArgumentNull_String);
+ }
+
+ if (filepath.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "filepath");
+ }
+
+ string dir = filepath.Substring(0, filepath.LastIndexOf("\\"));
if(!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
@@ -239,7 +276,12 @@ />
public static int InsertImage(Image image, byte[] Buffer)
{
- if(SaveImage(Buffer,image.OriginalFilePath))
+ if (image == null)
+ {
+ throw new ArgumentNullException("image", Resources.ArgumentNull_Generic);
+ }
+
+ if (SaveImage(Buffer, image.OriginalFilePath))
{
MakeAlbumImages(image);
return ObjectProvider.Instance().InsertImage(image);
@@ -255,6 +297,11 @@ />
// added
public static void Update(Image image, byte[] Buffer)
{
+ if (image == null)
+ {
+ throw new ArgumentNullException("image", Resources.ArgumentNull_Generic);
+ }
+
if(SaveImage(Buffer, image.OriginalFilePath))
{
MakeAlbumImages(image);
@@ -264,11 +311,26 @@ />
public static void DeleteImage(Image _image)
{
- ObjectProvider.Instance().DeleteImage(_image.ImageID);
+ if (_image == null)
+ {
+ throw new ArgumentNullException("_image", Resources.ArgumentNull_Generic);
+ }
+
+ ObjectProvider.Instance().DeleteImage(_image.ImageID);
}
public static void TryDeleteFile(string file)
{
+ if (file == null)
+ {
+ throw new ArgumentNullException("file", Resources.ArgumentNull_String);
+ }
+
+ if (file.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "file");
+ }
+
if(File.Exists(file))
{
File.Delete(file);
Modified: trunk/SubtextSolution/Subtext.Framework/ImportExport/SubtextBlogMlProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/ImportExport/SubtextBlogMlProvider.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/ImportExport/SubtextBlogMlProvider.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -20,6 +20,7 @@ />
using Subtext.Framework.Format;
using Subtext.Framework.Text;
using Subtext.ImportExport.Conversion;
+using Subtext.Framework.Properties;
namespace Subtext.ImportExport
{
@@ -96,7 +97,7 @@ />
for (int i = 0; i < bmlPosts.Count; i++)
{
BlogMLPost post = bmlPosts[i];
- int postId = int.Parse(post.ID);
+ int postId = Int32.Parse(post.ID, NumberFormatInfo.InvariantInfo);
// We are going to make use of the fact that everything is ordered by Post Id ASC
// to optimize this...
while (reader.Read())
@@ -109,7 +110,7 @@ />
{
i++;
post = bmlPosts[i];
- postId = int.Parse(post.ID);
+ postId = Int32.Parse(post.ID, NumberFormatInfo.InvariantInfo);
}
}
@@ -132,9 +133,11 @@ />
private IDataReader GetPostsAndArticlesReader(string blogId, int pageIndex, int pageSize)
{
int blogIdValue;
- if (!int.TryParse(blogId, out blogIdValue))
- throw new ArgumentException(string.Format("Invalid blog id '{0}' specified", blogId), "blogId");
-
+ if (!Int32.TryParse(blogId, out blogIdValue))
+ {
+ throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, Resources.Format_InvalidBlogId, blogId), "blogId");
+ }
+
SqlParameter[] p =
{
DataHelper.MakeInParam("@BlogId", SqlDbType.Int, 4, blogIdValue),
@@ -163,7 +166,7 @@ />
// TODO: in Subtext 2.0 we need to account for multiple authors.
BlogMLAuthor bmlAuthor = new BlogMLAuthor();
- bmlAuthor.ID = blog.Id.ToString();
+ bmlAuthor.ID = blog.Id.ToString(CultureInfo.InvariantCulture);
bmlAuthor.Title = blog.Author;
bmlAuthor.Approved = true;
bmlAuthor.Email = blog.Owner.Email;
@@ -188,7 +191,7 @@ />
foreach(LinkCategory category in categories)
{
BlogMLCategory bmlCategory = new BlogMLCategory();
- bmlCategory.ID = category.Id.ToString();
+ bmlCategory.ID = category.Id.ToString(CultureInfo.InvariantCulture);
bmlCategory.Title = category.Title;
bmlCategory.Approved = category.IsActive;
bmlCategory.DateCreated = DateTime.Now;
@@ -345,22 +348,37 @@ />
/// Creates a comment in the system.
/// </summary>
/// <param name="bmlComment"></param>
- public override void CreatePostComment(BlogMLComment bmlComment, string newPostId)
+ public override void CreatePostComment(BlogMLComment comment, string newPostId)
{
- FeedbackItem newComment = new FeedbackItem(FeedbackType.Comment);
+ if (comment == null)
+ {
+ throw new ArgumentNullException("comment", Resources.ArgumentNull_Generic);
+ }
+
+ if (newPostId == null)
+ {
+ throw new ArgumentNullException("newPostId", Resources.ArgumentNull_String);
+ }
+
+ if (newPostId.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "newPostId");
+ }
+
+ FeedbackItem newComment = new FeedbackItem(FeedbackType.Comment);
newComment.BlogId = Config.CurrentBlog.Id;
- newComment.EntryId = int.Parse(newPostId);
- newComment.Title = bmlComment.Title ?? string.Empty;
- newComment.DateCreated = bmlComment.DateCreated;
- newComment.DateModified = bmlComment.DateModified;
- newComment.Body = StringHelper.ReturnCheckForNull(bmlComment.Content.UncodedText);
- newComment.Approved = bmlComment.Approved;
- newComment.Author = StringHelper.ReturnCheckForNull(bmlComment.UserName);
- newComment.Email = bmlComment.UserEMail;
+ newComment.EntryId = Int32.Parse(newPostId, NumberFormatInfo.InvariantInfo);
+ newComment.Title = comment.Title ?? string.Empty;
+ newComment.DateCreated = comment.DateCreated;
+ newComment.DateModified = comment.DateModified;
+ newComment.Body = StringHelper.ReturnCheckForNull(comment.Content.UncodedText);
+ newComment.Approved = comment.Approved;
+ newComment.Author = StringHelper.ReturnCheckForNull(comment.UserName);
+ newComment.Email = comment.UserEMail;
- if (!string.IsNullOrEmpty(bmlComment.UserUrl))
+ if (!string.IsNullOrEmpty(comment.UserUrl))
{
- newComment.SourceUrl = new Uri(bmlComment.UserUrl);
+ newComment.SourceUrl = new Uri(comment.UserUrl);
}
FeedbackItem.Create(newComment, null);
@@ -372,9 +390,24 @@ />
/// <param name="trackback"></param>
public override void CreatePostTrackback(BlogMLTrackback trackback, string newPostId)
{
+ if (trackback == null)
+ {
+ throw new ArgumentNullException("trackback", Resources.ArgumentNull_Generic);
+ }
+
+ if (newPostId == null)
+ {
+ throw new ArgumentNullException("newPostId", Resources.ArgumentNull_String);
+ }
+
+ if (newPostId.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "newPostId");
+ }
+
FeedbackItem newPingTrack = new FeedbackItem(FeedbackType.PingTrack);
newPingTrack.BlogId = Config.CurrentBlog.Id;
- newPingTrack.EntryId = int.Parse(newPostId);
+ newPingTrack.EntryId = Int32.Parse(newPostId, NumberFormatInfo.InvariantInfo);
newPingTrack.Title = trackback.Title;
newPingTrack.SourceUrl = new Uri(trackback.Url);
newPingTrack.Approved = trackback.Approved;
Modified: trunk/SubtextSolution/Subtext.Framework/ImportManager.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/ImportManager.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/ImportManager.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -13,6 +13,7 @@ />
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion
+using System;
using System.Web.UI;
using Subtext.Extensibility.Interfaces;
using Subtext.Extensibility.Providers;
@@ -21,6 +22,7 @@ />
using Subtext.Framework.Providers;
using Subtext.Framework.UI.Skinning;
using SkinConfig = Subtext.Framework.Configuration.SkinConfig;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -36,6 +38,11 @@ />
/// <returns></returns>
public static Control GetImportInformationControl(ImportProvider provider)
{
+ if (provider == null)
+ {
+ throw new ArgumentNullException("provider", Resources.ArgumentNull_Generic);
+ }
+
return provider.GatherImportInformation();
}
@@ -49,6 +56,16 @@ />
/// <returns></returns>
public static string ValidateImportAnswers(Control populatedControl, ImportProvider provider)
{
+ if (populatedControl == null)
+ {
+ throw new ArgumentNullException("populatedControl", Resources.ArgumentNull_Generic);
+ }
+
+ if (provider == null)
+ {
+ throw new ArgumentNullException("provider", Resources.ArgumentNull_Generic);
+ }
+
return provider.ValidateImportInformation(populatedControl);
}
Modified: trunk/SubtextSolution/Subtext.Framework/NamespaceDocumentation.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/NamespaceDocumentation.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/NamespaceDocumentation.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -20,12 +20,15 @@ />
// http://ndoc.sourceforge.net/reference/NDoc.Core.Reflection.BaseReflectionDocumenterConfig.UseNamespaceDocSummaries.html
#if DOCUMENTATION
+using System.Diagnostics.CodeAnalysis;
+
namespace Subtext
{
/// <summary>
/// Subtext is a blogging engine built on the .NET Framework.
/// For more information, check out SubtextProject.com.
/// </summary>
+ [SupssMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "This class is used to generate namespace summary documentation.")]
internal sealed class NamespaceDoc
{
private NamespaceDoc()
@@ -40,6 +43,7 @@ />
/// Contains the primary framework classes used by
/// the Subtext blogging engine.
/// </summary>
+ [SupssMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "This class is used to generate namespace summary documentation.")]
internal sealed class NamespaceDoc
{
private NamespaceDoc()
@@ -70,6 +74,7 @@ />
/// the configuration as well.
/// </p>
/// </summary>
+ [SupssMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "This class is used to generate namespace summary documentation.")]
internal sealed class NamespaceDoc
{
private NamespaceDoc()
@@ -84,6 +89,7 @@ />
/// Contains the primary business layer classes such as <see cref="Entry"/>,
/// <see cref="Image"/>, <see cref="KeyWord"/>.
/// </summary>
+ [SupssMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "This class is used to generate namespace summary documentation.")]
internal sealed class NamespaceDoc
{
private NamespaceDoc()
Modified: trunk/SubtextSolution/Subtext.Framework/Plugins/PluginBase.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Plugins/PluginBase.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Plugins/PluginBase.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -79,12 +79,12 @@ />
#region Attribute Accessor Helpers
private static PluginImplementationInfo GetInfoFromAttribute(Type type)
{
- Attribute[] attrs = System.Attribute.GetCustomAttributes(type);
+ Attribute[] attrs = System.Attribute.GetCustomAttributes(type, typeof(DescriptionAttribute));
foreach (Attribute attr in attrs)
{
- if (attr is DescriptionAttribute)
+ DescriptionAttribute descAttr = attr as DescriptionAttribute;
+ if (descAttr != null)
{
- DescriptionAttribute descAttr = (DescriptionAttribute)attr;
PluginImplementationInfo info = new PluginImplementationInfo();
info._name = descAttr.Name;
@@ -102,12 +102,12 @@ />
private static Guid GetGuidFromAttribute(Type type)
{
- Attribute[] attrs = System.Attribute.GetCustomAttributes(type);
+ Attribute[] attrs = System.Attribute.GetCustomAttributes(type, typeof(IdentifierAttribute));
foreach (Attribute attr in attrs)
{
- if (attr is IdentifierAttribute)
+ IdentifierAttribute idAttr = attr as IdentifierAttribute;
+ if (idAttr != null)
{
- IdentifierAttribute idAttr = (IdentifierAttribute)attr;
return idAttr.Guid;
}
}
Added: trunk/SubtextSolution/Subtext.Framework/Properties/GlobalSupssions.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Properties/GlobalSupssions.cs (rev 0)
+++ trunk/SubtextSolution/Subtext.Framework/Properties/GlobalSupssions.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -0,0 +1,55 @@ />
+// ---------------------------------------------------------------------------
+// GlobalSupssions.cs
+//
+// Provides assembly level (global) CodeAnalysis supssions for FxCop.
+//
+// While static code analysis with FxCop is excellent for catching many common
+// and not so common code errors, there are some things that it flags that
+// do not always apply to the project at hand. For those cases, FxCop allows
+// you to exclude the message (and optionally give a justification reason for
+// excluding it). However, those exclusions are stored only in the FxCop
+// project file. In the 2.0 version of the .NET framework, Microsoft introduced
+// SupssMessageAttribute, which is used primarily by the version of FxCop
+// that is built in to Visual Studio. As this built-in functionality is not
+// included in all versions of Visual Studio, we have opted to continue
+// using the standalone version of FxCop.
+//
+// In order for this version to recognize SussMessageAttribute, the
+// CODE_ANALYSIS symbol must be defined.
+//
+// ---------------------------------------------------------------------------
+using System.Diagnostics.CodeAnalysis;
+
+[assembly: SupssMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Scope ="assembly", Justification = "Assemblies are not currently being signed.")]
+
+// FxCop says that namespaces should generally have more than five types.
+// Unfortunately, not all of these namespaces currently have more than five
+// types but we still want the namespace so we can expand the library in the
+// future without moving types around.
+#region CA1020:AvoidNamespacesWithFewTypes
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Web.Handlers", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.ImportExport.Conversion", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.ImportExport", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Providers", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Syndication.Comssion", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Format", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Web", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Services", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Email", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Text", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Security", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Web.HttpModules", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+[assembly: SupssMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Subtext.Framework.Web.HttpModules", Justification = "Ignoring this warning...we want this namespace, but don't have enough classes to go in it right now to satisfy the rule.")]
+#endregion
+
+// We could use a CustomDictionary.xml file to handle the spelling and case
+// rules, but VS2005 Code Analysis doesn't support them and the FxCop add-ins
+// and custom external tools don't rely on a project file, so we can't specify
+// the location of the CustomDictionary.xml file. We don't want to modify the
+// default file that ships with the FxCop distribution either. This does make
+// more work for us, but it is the safest solution.
+#region CA1704:IdentifiersShouldBeSpelledCorrectly
+//[assembly: SupssMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "Subtext.BlogML.Interfaces.IBlogMLProvider.CreatePostTrackback(BlogML.Xml.BlogMLTrackback,System.String):System.Void", MessageId = "0#trackback")]
+//[assembly: SupssMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "Subtext.BlogML.Interfaces.IBlogMLProvider.CreatePostTrackback(BlogML.Xml.BlogMLTrackback,System.String):System.Void", MessageId = "Trackback")]
+#endregion
+
Added: trunk/SubtextSolution/Subtext.Framework/Properties/Resources.Designer.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Properties/Resources.Designer.cs (rev 0)
+++ trunk/SubtextSolution/Subtext.Framework/Properties/Resources.Designer.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -0,0 +1,486 @@ />
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Subtext.Framework.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SupssMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Subtext.Framework.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid HandlerType: Unknown.
+ /// </summary>
+ internal static string ApplicationException_UnknownHandlerType {
+ get {
+ return ResourceManager.GetString("ApplicationException_UnknownHandlerType", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to are {0} blogs.
+ /// </summary>
+ internal static string AreBlogs {
+ get {
+ return ResourceManager.GetString("AreBlogs", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Semaphore must have a count of at least 0..
+ /// </summary>
+ internal static string Argument_SemaphoreCountLessThanZero {
+ get {
+ return ResourceManager.GetString("Argument_SemaphoreCountLessThanZero", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to String cannot be of zero length..
+ /// </summary>
+ internal static string Argument_StringZeroLength {
+ get {
+ return ResourceManager.GetString("Argument_StringZeroLength", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Array cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Array {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Array", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to At least one element in the specified array was null..
+ /// </summary>
+ internal static string ArgumentNull_ArrayElement {
+ get {
+ return ResourceManager.GetString("ArgumentNull_ArrayElement", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Found a null value within an array..
+ /// </summary>
+ internal static string ArgumentNull_ArrayValue {
+ get {
+ return ResourceManager.GetString("ArgumentNull_ArrayValue", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Assembly cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Assembly {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Assembly", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to AssemblyName cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_AssemblyName {
+ get {
+ return ResourceManager.GetString("ArgumentNull_AssemblyName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to AssemblyName.Name cannot be null or an empty string..
+ /// </summary>
+ internal static string ArgumentNull_AssemblyNameName {
+ get {
+ return ResourceManager.GetString("ArgumentNull_AssemblyNameName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Buffer cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Buffer {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Buffer", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Collection cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Collection {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Collection", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Dictionary cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Dictionary {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Dictionary", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to File name cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_FileName {
+ get {
+ return ResourceManager.GetString("ArgumentNull_FileName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Value cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Generic {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Generic", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Object Graph cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Graph {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Graph", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to GUID cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_GUID {
+ get {
+ return ResourceManager.GetString("ArgumentNull_GUID", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Key cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Key {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Key", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Member at position {0} was null..
+ /// </summary>
+ internal static string ArgumentNull_NullMember {
+ get {
+ return ResourceManager.GetString("ArgumentNull_NullMember", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Object cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Obj {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Obj", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Path cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Path {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Path", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Provider cannot be null.
+ /// </summary>
+ internal static string ArgumentNull_Provider {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Provider", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Stream cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Stream {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Stream", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to String reference not set to an instance of a String..
+ /// </summary>
+ internal static string ArgumentNull_String {
+ get {
+ return ResourceManager.GetString("ArgumentNull_String", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Type cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Type {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Type", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to URI cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_Uri {
+ get {
+ return ResourceManager.GetString("ArgumentNull_Uri", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Parameter '{0}' cannot be null..
+ /// </summary>
+ internal static string ArgumentNull_WithParamName {
+ get {
+ return ResourceManager.GetString("ArgumentNull_WithParamName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Index and length must refer to a location within the string..
+ /// </summary>
+ internal static string ArgumentOutOfRange_IndexLength {
+ get {
+ return ResourceManager.GetString("ArgumentOutOfRange_IndexLength", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to SartIndex cannot be less than zero..
+ /// </summary>
+ internal static string ArgumentOutOfRange_StartIndex {
+ get {
+ return ResourceManager.GetString("ArgumentOutOfRange_StartIndex", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Length cannot be less than zero..
+ /// </summary>
+ internal static string ArgumnetOutOfRange_Length {
+ get {
+ return ResourceManager.GetString("ArgumnetOutOfRange_Length", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Sorry, but there {0} with the specified hostname '{1}'. To set up another blog with the same hostname, you must provide an subfolder name. Please click on 'Host Domain' below for more information..
+ /// </summary>
+ internal static string BlogRequiresSubfolder_Generic {
+ get {
+ return ResourceManager.GetString("BlogRequiresSubfolder_Generic", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to No connection string matches the key '{0}'..
+ /// </summary>
+ internal static string Configuration_KeyNotFound {
+ get {
+ return ResourceManager.GetString("Configuration_KeyNotFound", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to ExtendedProperties bytes overflow. The ExtendedProperties is limited to 7800 bytes.
+ /// </summary>
+ internal static string ExtendedPropertiesOverflow_Generic {
+ get {
+ return ResourceManager.GetString("ExtendedPropertiesOverflow_Generic", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to String was not recognized as a valid DateTime..
+ /// </summary>
+ internal static string Format_BadDateTime {
+ get {
+ return ResourceManager.GetString("Format_BadDateTime", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid blog id '{0}' specified.
+ /// </summary>
+ internal static string Format_InvalidBlogId {
+ get {
+ return ResourceManager.GetString("Format_InvalidBlogId", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cannot specify a feedburner name with invalid characters..
+ /// </summary>
+ internal static string Format_InvalidFeedburnerName {
+ get {
+ return ResourceManager.GetString("Format_InvalidFeedburnerName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Invalid Post ID..
+ /// </summary>
+ internal static string Format_InvalidPostId {
+ get {
+ return ResourceManager.GetString("Format_InvalidPostId", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Missing attribute '{0}'..
+ /// </summary>
+ internal static string HttpException_MissingAttribute {
+ get {
+ return ResourceManager.GetString("HttpException_MissingAttribute", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cannot destroy an active comment..
+ /// </summary>
+ internal static string InvalidOperation_DestroyActiveComment {
+ get {
+ return ResourceManager.GetString("InvalidOperation_DestroyActiveComment", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cannot destroy an approved comment. Please flag it as spam or trash it first..
+ /// </summary>
+ internal static string InvalidOperation_DestroyApprovedComment {
+ get {
+ return ResourceManager.GetString("InvalidOperation_DestroyApprovedComment", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cannot create a Host record. One already exists..
+ /// </summary>
+ internal static string InvalidOperation_HostRecordExists {
+ get {
+ return ResourceManager.GetString("InvalidOperation_HostRecordExists", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to We'd all like to be able to go back in time, but this is not allowed. Please choose a positive wait time..
+ /// </summary>
+ internal static string InvalidOperation_WaitTimeLessThanZero {
+ get {
+ return ResourceManager.GetString("InvalidOperation_WaitTimeLessThanZero", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to is another blog.
+ /// </summary>
+ internal static string IsAnotherBlog {
+ get {
+ return ResourceManager.GetString("IsAnotherBlog", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The method or operation is not implemented..
+ /// </summary>
+ internal static string NotImplementedException_Generic {
+ get {
+ return ResourceManager.GetString("NotImplementedException_Generic", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Role exists.
+ /// </summary>
+ internal static string SecurityException_RoleExists {
+ get {
+ return ResourceManager.GetString("SecurityException_RoleExists", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Timeout waiting for lock.
+ /// </summary>
+ internal static string TimeoutWaitingForLock {
+ get {
+ return ResourceManager.GetString("TimeoutWaitingForLock", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to TotalRecords.
+ /// </summary>
+ internal static string TotalRecords {
+ get {
+ return ResourceManager.GetString("TotalRecords", resourceCulture);
+ }
+ }
+ }
+}
Added: trunk/SubtextSolution/Subtext.Framework/Properties/Resources.resx
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Properties/Resources.resx (rev 0)
+++ trunk/SubtextSolution/Subtext.Framework/Properties/Resources.resx 2006-12-17 20:12:47 UTC (rev 2156)
@@ -0,0 +1,261 @@ />
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string resenting a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="" target="_blank">http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="" target="_blank">http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="Argument_StringZeroLength" xml:space="serve">
+ <value>String cannot be of zero length.</value>
+ </data>
+ <data name="ArgumentNull_Array" xml:space="serve">
+ <value>Array cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_ArrayElement" xml:space="serve">
+ <value>At least one element in the specified array was null.</value>
+ </data>
+ <data name="ArgumentNull_ArrayValue" xml:space="serve">
+ <value>Found a null value within an array.</value>
+ </data>
+ <data name="ArgumentNull_Assembly" xml:space="serve">
+ <value>Assembly cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_AssemblyName" xml:space="serve">
+ <value>AssemblyName cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_AssemblyNameName" xml:space="serve">
+ <value>AssemblyName.Name cannot be null or an empty string.</value>
+ </data>
+ <data name="ArgumentNull_Buffer" xml:space="serve">
+ <value>Buffer cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Collection" xml:space="serve">
+ <value>Collection cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Dictionary" xml:space="serve">
+ <value>Dictionary cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_FileName" xml:space="serve">
+ <value>File name cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Generic" xml:space="serve">
+ <value>Value cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Graph" xml:space="serve">
+ <value>Object Graph cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_GUID" xml:space="serve">
+ <value>GUID cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Key" xml:space="serve">
+ <value>Key cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_NullMember" xml:space="serve">
+ <value>Member at position {0} was null.</value>
+ </data>
+ <data name="ArgumentNull_Obj" xml:space="serve">
+ <value>Object cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Path" xml:space="serve">
+ <value>Path cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Provider" xml:space="serve">
+ <value>Provider cannot be null</value>
+ </data>
+ <data name="ArgumentNull_Stream" xml:space="serve">
+ <value>Stream cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_String" xml:space="serve">
+ <value>String reference not set to an instance of a String.</value>
+ </data>
+ <data name="ArgumentNull_Type" xml:space="serve">
+ <value>Type cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_Uri" xml:space="serve">
+ <value>URI cannot be null.</value>
+ </data>
+ <data name="ArgumentNull_WithParamName" xml:space="serve">
+ <value>Parameter '{0}' cannot be null.</value>
+ </data>
+ <data name="InvalidOperation_DestroyActiveComment" xml:space="serve">
+ <value>Cannot destroy an active comment.</value>
+ </data>
+ <data name="InvalidOperation_DestroyApprovedComment" xml:space="serve">
+ <value>Cannot destroy an approved comment. Please flag it as spam or trash it first.</value>
+ </data>
+ <data name="Argument_SemaphoreCountLessThanZero" xml:space="serve">
+ <value>Semaphore must have a count of at least 0.</value>
+ </data>
+ <data name="TimeoutWaitingForLock" xml:space="serve">
+ <value>Timeout waiting for lock</value>
+ </data>
+ <data name="InvalidOperation_WaitTimeLessThanZero" xml:space="serve">
+ <value>We'd all like to be able to go back in time, but this is not allowed. Please choose a positive wait time.</value>
+ </data>
+ <data name="InvalidOperation_HostRecordExists" xml:space="serve">
+ <value>Cannot create a Host record. One already exists.</value>
+ </data>
+ <data name="Format_InvalidFeedburnerName" xml:space="serve">
+ <value>Cannot specify a feedburner name with invalid characters.</value>
+ </data>
+ <data name="ExtendedPropertiesOverflow_Generic" xml:space="serve">
+ <value>ExtendedProperties bytes overflow. The ExtendedProperties is limited to 7800 bytes</value>
+ </data>
+ <data name="BlogRequiresSubfolder_Generic" xml:space="serve">
+ <value>Sorry, but there {0} with the specified hostname '{1}'. To set up another blog with the same hostname, you must provide an subfolder name. Please click on 'Host Domain' below for more information.</value>
+ </data>
+ <data name="IsAnotherBlog" xml:space="serve">
+ <value>is another blog</value>
+ </data>
+ <data name="AreBlogs" xml:space="serve">
+ <value>are {0} blogs</value>
+ </data>
+ <data name="Format_BadDateTime" xml:space="serve">
+ <value>String was not recognized as a valid DateTime.</value>
+ </data>
+ <data name="NotImplementedException_Generic" xml:space="serve">
+ <value>The method or operation is not implemented.</value>
+ </data>
+ <data name="ApplicationException_UnknownHandlerType" xml:space="serve">
+ <value>Invalid HandlerType: Unknown</value>
+ </data>
+ <data name="Format_InvalidBlogId" xml:space="serve">
+ <value>Invalid blog id '{0}' specified</value>
+ </data>
+ <data name="TotalRecords" xml:space="serve">
+ <value>TotalRecords</value>
+ </data>
+ <data name="Format_InvalidPostId" xml:space="serve">
+ <value>Invalid Post ID.</value>
+ </data>
+ <data name="Configuration_KeyNotFound" xml:space="serve">
+ <value>No connection string matches the key '{0}'.</value>
+ </data>
+ <data name="HttpException_MissingAttribute" xml:space="serve">
+ <value>Missing attribute '{0}'.</value>
+ </data>
+ <data name="SecurityException_RoleExists" xml:space="serve">
+ <value>Role exists</value>
+ </data>
+ <data name="ArgumentOutOfRange_IndexLength" xml:space="serve">
+ <value>Index and length must refer to a location within the string.</value>
+ </data>
+ <data name="ArgumentOutOfRange_StartIndex" xml:space="serve">
+ <value>SartIndex cannot be less than zero.</value>
+ </data>
+ <data name="ArgumnetOutOfRange_Length" xml:space="serve">
+ <value>Length cannot be less than zero.</value>
+ </data>
+</root>
\ No newline at end of file
Modified: trunk/SubtextSolution/Subtext.Framework/Providers/DotNetOpenMailProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Providers/DotNetOpenMailProvider.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Providers/DotNetOpenMailProvider.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -18,6 +18,7 @@ />
using DotNetOpenMail.SmtpAuth;
using Subtext.Extensibility.Providers;
using Subtext.Framework.Logging;
+using System.Globalization;
namespace Subtext.Framework.Providers
{
@@ -60,13 +61,13 @@ />
//Mail Exception is thrown when there are network or connection errors
catch(MailException mailEx)
{
- string msg = String.Format("Connection or network error sending email from {0} to {1}", from, to);
+ string msg = String.Format(CultureInfo.CurrentUICulture, "Connection or network error sending email from {0} to {1}", from, to);
Log.Error(msg, mailEx);
}
//SmtpException is thrown for all SMTP exceptions
catch (SmtpException smtpEx)
{
- string msg = String.Format("Error sending email from {0} to {1}", from, to);
+ string msg = String.Format(CultureInfo.CurrentUICulture, "Error sending email from {0} to {1}", from, to);
Log.Error(msg, smtpEx);
}
return false;
Modified: trunk/SubtextSolution/Subtext.Framework/Security/SecurityHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Security/SecurityHelper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Security/SecurityHelper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -29,6 +29,7 @@ />
using Subtext.Framework.Logging;
using Subtext.Framework.Text;
using Subtext.Framework.Web;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Security
{
@@ -462,7 +463,7 @@ />
}
else
{
- return "Blog_" + BlogId.ToString();
+ return String.Format(CultureInfo.InvariantCulture, "Blog_{0}", BlogId);
}
}
}
Modified: trunk/SubtextSolution/Subtext.Framework/Security/SubtextMembershipProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Security/SubtextMembershipProvider.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Security/SubtextMembershipProvider.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -6,6 +6,8 @@ />
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using Subtext.Framework.Data;
+using System.Globalization;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Security
{
@@ -105,7 +107,7 @@ />
/// </returns>
public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
- throw new NotImplementedException("The method or operation is not implemented.");
+ throw new NotImplementedException(Resources.NotImplementedException_Generic);
}
/// <summary>
@@ -233,7 +235,7 @@ />
{
get
{
- return Convert.ToBoolean(_config["enablePasswordReset"]);
+ return Convert.ToBoolean(_config["enablePasswordReset"], CultureInfo.InvariantCulture);
}
}
@@ -246,7 +248,7 @@ />
{
get
{
- return Convert.ToBoolean(_config["enablePasswordRetrieval"]);
+ return Convert.ToBoolean(_config["enablePasswordRetrieval"], CultureInfo.InvariantCulture);
}
}
@@ -263,9 +265,16 @@ />
/// </returns>
public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
{
- if (String.IsNullOrEmpty(emailToMatch))
- throw new ArgumentNullException("emailToMatch", "Must specify an email to match.");
+ if (emailToMatch == null)
+ {
+ throw new ArgumentNullException("emailToMatch", Resources.ArgumentNull_String);
+ }
+ if (emailToMatch.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "emailToMatch");
+ }
+
MembershipUserCollection foundUsers = new MembershipUserCollection();
using (SqlConnection conn = new SqlConnection(this.connectionString))
@@ -309,9 +318,16 @@ />
/// </returns>
public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
- if (String.IsNullOrEmpty(usernameToMatch))
- throw new ArgumentNullException("usernameToMatch", "Must specify a username to match.");
+ if (usernameToMatch == null)
+ {
+ throw new ArgumentNullException("usernameToMatch", Resources.ArgumentNull_String);
+ }
+ if (usernameToMatch.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "usernameToMatch");
+ }
+
MembershipUserCollection foundUsers = new MembershipUserCollection();
using (SqlConnection conn = new SqlConnection(this.connectionString))
{
@@ -419,7 +435,7 @@ />
/// </returns>
public override string GetPassword(string username, string answer)
{
- throw new NotImplementedException("The method or operation is not implemented.");
+ throw new NotImplementedException(Resources.NotImplementedException_Generic);
}
/// <summary>
@@ -511,7 +527,7 @@ />
{
get
{
- return Convert.ToInt32(_config["maxInvalidPasswordAttempts"]);
+ return Convert.ToInt32(_config["maxInvalidPasswordAttempts"], NumberFormatInfo.InvariantInfo);
}
}
@@ -525,7 +541,7 @@ />
{
get
{
- return Convert.ToInt32(_config["minRequiredNonAlphanumericCharacters"]);
+ return Convert.ToInt32(_config["minRequiredNonAlphanumericCharacters"], NumberFormatInfo.InvariantInfo);
}
}
@@ -538,7 +554,7 @@ />
{
get
{
- return Convert.ToInt32(_config["minRequiredPasswordLength"]);
+ return Convert.ToInt32(_config["minRequiredPasswordLength"], NumberFormatInfo.InvariantInfo);
}
}
@@ -555,7 +571,7 @@ />
{
get
{
- return Convert.ToInt32(_config["passwordAttemptWindow"]);
+ return Convert.ToInt32(_config["passwordAttemptWindow"], NumberFormatInfo.InvariantInfo);
}
}
@@ -592,7 +608,7 @@ />
{
get
{
- return Convert.ToBoolean(_config["requiresQuestionAndAnswer"]);
+ return Convert.ToBoolean(_config["requiresQuestionAndAnswer"], CultureInfo.InvariantCulture);
}
}
@@ -607,7 +623,7 @@ />
{
get
{
- return Convert.ToBoolean(_config["requiresUniqueEmail"]);
+ return Convert.ToBoolean(_config["requiresUniqueEmail"], CultureInfo.InvariantCulture);
}
}
@@ -619,12 +635,26 @@ />
/// <returns>The new password for the specified user.</returns>
public override string ResetPassword(string username, string answer)
{
- if (username == null)
- throw new ArgumentNullException("username", "Username cannot be null");
+ if (username == null)
+ {
+ throw new ArgumentNullException("username", Resources.ArgumentNull_String);
+ }
- if (answer == null)
- throw new ArgumentNullException("answer", "Must provide some answer");
+ if (answer == null)
+ {
+ throw new ArgumentNullException("answer", Resources.ArgumentNull_String);
+ }
+ if (username.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "username");
+ }
+
+ if (answer.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "answer");
+ }
+
MembershipUser user = GetUser(username, true);
if (user == null)
throw new InvalidOperationException("Cannot reset the password for a null user.");
@@ -664,7 +694,7 @@ />
/// </returns>
public override bool UnlockUser(string userName)
{
- throw new NotImplementedException("The method or operation is not implemented.");
+ throw new NotImplementedException(Resources.NotImplementedException_Generic);
}
/// <summary>
Modified: trunk/SubtextSolution/Subtext.Framework/Security/SubtextRoleProvider.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Security/SubtextRoleProvider.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Security/SubtextRoleProvider.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -5,6 +5,9 @@ />
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using Subtext.Framework.Data;
+using System.Text;
+using Subtext.Framework.Properties;
+using System.Globalization;
namespace Subtext.Framework.Security
{
@@ -15,18 +18,23 @@ />
public override void Initialize(string name, NameValueCollection config)
{
- if (string.IsNullOrEmpty(name))
+ if (String.IsNullOrEmpty(name))
+ {
name = "SubtextMembershipProvider";
+ }
+
base.Initialize(name, config);
string csn = config["connectionStringName"];
if (string.IsNullOrEmpty(csn))
- throw new HttpException("Missing attribute 'connectionStringName'");
+ {
+ throw new HttpException(String.Format(CultureInfo.CurrentUICulture, Resources.HttpException_MissingAttribute, "connectionStringName"));
+ }
this.connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[csn].ConnectionString;
if (string.IsNullOrEmpty(this.connectionString))
- throw new Exception("The connection string " + csn + "was not found");
+ throw new Exception(String.Format(CultureInfo.CurrentUICulture, Resources.Configuration_KeyNotFound, csn));
config.Remove("connectionStringName");
}
@@ -53,18 +61,22 @@ />
public override void AddUsersToRoles(string[] usernames, string[] roleNames)
{
string cdUserNames = "";
+ string cdRoleNames = "";
+
+ StringBuilder builder = new StringBuilder();
foreach (string s in usernames)
{
- cdUserNames += s + ",";
+ builder.AppendFormat("{0},", s);
}
- cdUserNames = cdUserNames.Remove(cdUserNames.Length - 1);
+ cdUserNames = builder.ToString().Remove(builder.Length - 1);
- string cdRoleNames = "";
+ builder = new StringBuilder();
+
foreach (string s in roleNames)
{
- cdRoleNames += s + ",";
+ builder.AppendFormat("{0},", s);
}
- cdRoleNames = cdRoleNames.Remove(cdRoleNames.Length - 1);
+ cdRoleNames = builder.ToString().Remove(builder.Length - 1);
SqlConnection conn = new SqlConnection(this.connectionString);
SqlCommand cmd = new SqlCommand("subtext_UsersInRoles_AddUsersToRoles", conn);
@@ -94,7 +106,7 @@ />
conn.Open();
if (cmd.ExecuteNonQuery() != 1)
{
- throw new Exception("Role exists");
+ throw new Exception(Resources.SecurityException_RoleExists);
}
}
@@ -103,13 +115,13 @@ />
public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
{
//no need to delete roles at this moment from within Subtext (v2) - RA
- throw new Exception("The method or operation is not implemented.");
+ throw new Exception(Resources.NotImplementedException_Generic);
}
public override string[] FindUsersInRole(string roleName, string usernameToMatch)
{
//I've yet to figure out what the @!^&) this actually is for.
- throw new Exception("The method or operation is not implemented.");
+ throw new Exception(Resources.NotImplementedException_Generic);
}
public override string[] GetAllRoles()
@@ -208,7 +220,7 @@ />
public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new Exception(Resources.NotImplementedException_Generic);
}
/// <summary>
Modified: trunk/SubtextSolution/Subtext.Framework/Services/MailToWeblog.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Services/MailToWeblog.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Services/MailToWeblog.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -133,6 +133,8 @@ />
using Subtext.Framework.Data;
using Lesnikowski.Client;
using Lesnikowski.Mail;
+using System.Globalization;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Services
{
@@ -561,7 +563,7 @@ />
{
foreach (string fileName in attachedFiles)
{
- string fileNameU = fileName.ToUpper();
+ string fileNameU = fileName.ToUpperInvariant();
if (fileNameU.EndsWith(".JPG") || fileNameU.EndsWith(".JPEG") ||
fileNameU.EndsWith(".GIF") || fileNameU.EndsWith(".PNG") ||
fileNameU.EndsWith(".BMP"))
@@ -592,7 +594,7 @@ />
string absoluteUri = new Uri(binariesBaseUri, fileName).AbsoluteUri;
string absoluteThumbUri = new Uri(binariesBaseUri, thumbBaseFileName).AbsoluteUri;
- entry.Body += String.Format("<div class=\"inlinedMailPictureBox\"><a href=\"{0}\"><img border=\"0\" class=\"inlinedMailPicture\" src=\"{2}\"></a><br><a class=\"inlinedMailPictureLink\" href=\"{0}\">{1}</a></div>", absoluteUri, fileName, absoluteThumbUri);
+ entry.Body += String.Format(CultureInfo.InvariantCulture, "<div class=\"inlinedMailPictureBox\"><a href=\"{0}\"><img border=\"0\" class=\"inlinedMailPicture\" src=\"{2}\"></a><br><a class=\"inlinedMailPictureLink\" href=\"{0}\">{1}</a></div>", absoluteUri, fileName, absoluteThumbUri);
scalingSucceeded = true;
}
@@ -604,7 +606,7 @@ />
if (!scalingSucceeded)
{
string absoluteUri = new Uri(binariesBaseUri, fileName).AbsoluteUri;
- entry.Body += String.Format("<div class=\"inlinedMailPictureBox\"><img class=\"inlinedMailPicture\" src=\"{0}\"><br><a class=\"inlinedMailPictureLink\" href=\"{0}\">{1}</a></div>", absoluteUri, fileName);
+ entry.Body += String.Format(CultureInfo.InvariantCulture, "<div class=\"inlinedMailPictureBox\"><img class=\"inlinedMailPicture\" src=\"{0}\"><br><a class=\"inlinedMailPictureLink\" href=\"{0}\">{1}</a></div>", absoluteUri, fileName);
}
}
}
@@ -617,7 +619,7 @@ />
foreach (string fileName in attachedFiles)
{
- string fileNameU = fileName.ToUpper();
+ string fileNameU = fileName.ToUpperInvariant();
if (!activeblog.pop3InlineAttachedPictures ||
(!fileNameU.EndsWith(".JPG") && !fileNameU.EndsWith(".JPEG") &&
!fileNameU.EndsWith(".GIF") && !fileNameU.EndsWith(".PNG") &&
@@ -697,7 +699,7 @@ />
}
//if all the blogs and e-mails are processed thread may sleep here
//Sleep time comes from web.config
- Thread.Sleep(TimeSpan.FromSeconds(int.Parse(ConfigurationManager.AppSettings.Get("MTWThreadSleep"))));
+ Thread.Sleep(TimeSpan.FromSeconds(Int32.Parse(ConfigurationManager.AppSettings.Get("MTWThreadSleep"), NumberFormatInfo.InvariantInfo)));
}
/// <summary>
@@ -729,6 +731,11 @@ />
/// <returns></returns>
public string StoreAttachment(MimeData attachment)
{
+ if (attachment == null)
+ {
+ throw new ArgumentNullException(Resources.ArgumentNull_Generic);
+ }
+
bool alreadyUploaded = false;
string baseFileName = attachment.FileName;
string targetFileName = Path.Combine(binariesPath, baseFileName);
@@ -765,7 +772,7 @@ />
{
string ext = Path.GetExtension(baseFileName);
string file = Path.GetFileNameWithoutExtension(baseFileName);
- string newFileName = file + (numSuffix++).ToString();
+ string newFileName = file + (numSuffix++).ToString(NumberFormatInfo.InvariantInfo);
baseFileName = newFileName + ext;
targetFileName = Path.Combine(binariesPath, baseFileName);
}
Modified: trunk/SubtextSolution/Subtext.Framework/Stats.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Stats.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Stats.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -26,6 +26,7 @@ />
using Subtext.Framework.Tracking;
using Subtext.Framework.Logging;
using Subtext.Framework.Web;
+using Subtext.Framework.Properties;
namespace Subtext.Framework
{
@@ -180,6 +181,11 @@ />
/// <param name="entry">Entry.</param>
public static void Notify(Entry entry)
{
+ if (entry == null)
+ {
+ throw new ArgumentNullException("entry", Resources.ArgumentNull_Generic);
+ }
+
StringCollection links = HtmlHelper.GetLinks(entry.Body);
if(links != null && links.Count > 0)
Modified: trunk/SubtextSolution/Subtext.Framework/SubText.Framework.csproj
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/SubText.Framework.csproj 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/SubText.Framework.csproj 2006-12-17 20:12:47 UTC (rev 2156)
@@ -34,7 +34,7 @@ />
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
@@ -378,6 +378,12 @@ />
<Compile Include="Plugins\SubtextApplication.cs" />
<Compile Include="Plugins\SubtextEventArgs.cs" />
<Compile Include="Plugins\SubtextEvents.cs" />
+ <Compile Include="Properties\GlobalSupssions.cs" />
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
<Compile Include="Providers\DotNetOpenMailProvider.cs" />
<Compile Include="Providers\ObjectProvider.cs">
<SubType>Code</SubType>
@@ -466,6 +472,7 @@ />
<Compile Include="Tracking\TrackBackNotificationProxy.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Tracking\TrackbackResponseCode.cs" />
<Compile Include="Tracking\TrackHelpers.cs">
<SubType>Code</SubType>
</Compile>
@@ -551,6 +558,11 @@ />
<Content Include="ExternalDependencies\Velocit.RegularExssions.dll" />
<Content Include="license.txt" />
<Content Include="Logging\LoggingConfigurationExample.xml" />
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <SubType>Designer</SubType>
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
<EmbeddedResource Include="Util\WindowsTimeZoneCollection.xml" />
<None Include="MailLicense.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -562,6 +574,9 @@ />
<DependentUpon>WeblogsNotificatinProxy.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
+ <ItemGroup>
+ <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/AtomHandler.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/AtomHandler.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/AtomHandler.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -18,6 +18,7 @@ />
using Subtext.Framework.Components;
using Subtext.Framework.Syndication;
using DTCF = Subtext.Framework.Configuration;
+using System.Globalization;
namespace Subtext.Framework.Syndication
{
@@ -36,7 +37,7 @@ />
protected override string CacheKey(DateTime dateLastViewedFeedItemPublished)
{
const string key = "ATOM;IndividualMainFeed;BlogId:{0};LastViewed:{1}";
- return string.Format(key, CurrentBlog.Id, dateLastViewedFeedItemPublished);
+ return string.Format(CultureInfo.InvariantCulture, key, CurrentBlog.Id, dateLastViewedFeedItemPublished);
}
/// <summary>
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/BaseAtomWriter.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/BaseAtomWriter.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/BaseAtomWriter.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -214,7 +214,9 @@ />
this.WriteString
(
string.Format
- ("{0}{1}", //tag def
+ (
+ CultureInfo.CurrentUICulture,
+ "{0}{1}", //tag def
entry.SyndicateDescriptionOnly ? entry.Description : entry.Body, //use desc or full post
(UseAggBugs && settings.Tracking.EnableAggBugs) ? TrackingUrls.AggBugImage(urlFormats.AggBugkUrl(entry.Id)) : null //use aggbugs
)
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/BaseRssWriter.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/BaseRssWriter.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/BaseRssWriter.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -255,6 +255,7 @@ />
"description", //Tag
string.Format
(
+ CultureInfo.CurrentUICulture,
"{0}{1}", //tag def
GetBodyFromItem(item), (UseAggBugs && settings.Tracking.EnableAggBugs) ? TrackingUrls.AggBugImage(urlFormats.AggBugkUrl(item.Id)) : null //use aggbugs
)
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/CommentHandler.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/CommentHandler.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/CommentHandler.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -21,6 +21,7 @@ />
using Subtext.Framework.Components;
using Subtext.Framework.Format;
using Subtext.Framework.Text;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Syndication
{
@@ -47,6 +48,11 @@ />
/// <param name="context">Context.</param>
public override void HandleRequest(HttpContext context)
{
+ if (context == null)
+ {
+ throw new ArgumentNullException("context", Resources.ArgumentNull_Generic);
+ }
+
HttpRequest Request = context.Request;
if (Request.RequestType == "POST" && Request.ContentType == "text/xml")
{
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionHelper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionHelper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -16,6 +16,7 @@ />
using System;
using System.IO;
using blowery.Web.HttpComss;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Syndication.Comssion
{
@@ -24,6 +25,15 @@ />
#region -- GetFilterForScheme(schemes, Stream) Method --
public static SyndicationComssionFilter GetFilterForScheme(string schemes, Stream contextFilter)
{
+ if (schemes == null)
+ throw new ArgumentNullException("schemes", Resources.ArgumentNull_String);
+
+ if (schemes.Length == 0)
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "schemes");
+
+ if (contextFilter == null)
+ throw new ArgumentNullException("contextFilter", Resources.ArgumentNull_Stream);
+
SyndicationComssionSettings settings;
SyndicationComssionFilter filter = null;
bool foundDeflate = false;
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionSettings.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionSettings.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/Comssion/SyndicationComssionSettings.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -17,6 +17,7 @@ />
using System.Configuration;
using System.Xml;
using blowery.Web.HttpComss;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Syndication.Comssion
{
@@ -74,10 +75,20 @@ />
/*-- Methods --*/
#region -- RetrieveEnumFromAttribute(XmlAttribute, Type) Method --
- protected static Enum RetrieveEnumFromAttribute(XmlAttribute attribute, System.Type type)
- {
- return (Enum)Enum.Parse(type, attribute.Value, true);
- }
+ protected static Enum RetrieveEnumFromAttribute(XmlAttribute attribute, System.Type type)
+ {
+ if (attribute == null)
+ {
+ throw new ArgumentNullException("attribute", Resources.ArgumentNull_Generic);
+ }
+
+ if (type == null)
+ {
+ throw new ArgumentNullException("type", Resources.ArgumentNull_Type);
+ }
+
+ return (Enum)Enum.Parse(type, attribute.Value, true);
+ }
#endregion
/*-- Static Methods --*/
Modified: trunk/SubtextSolution/Subtext.Framework/Syndication/RssHandler.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Syndication/RssHandler.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Syndication/RssHandler.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -17,6 +17,7 @@ />
using Subtext.Framework;
using Subtext.Framework.Components;
using Subtext.Framework.Syndication;
+using System.Globalization;
namespace Subtext.Framework.Syndication
{
@@ -35,7 +36,7 @@ />
protected override string CacheKey(DateTime dateLastViewedFeedItemPublished)
{
const string key = "RSS;IndividualMainFeed;BlogId:{0};LastViewed:{1}";
- return string.Format(key, CurrentBlog.Id, dateLastViewedFeedItemPublished);
+ return string.Format(CultureInfo.InvariantCulture, key, CurrentBlog.Id, dateLastViewedFeedItemPublished);
}
/// <summary>
Modified: trunk/SubtextSolution/Subtext.Framework/Text/HtmlHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Text/HtmlHelper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Text/HtmlHelper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -26,6 +26,7 @@ />
using Subtext.Framework.Components;
using Subtext.Framework.Configuration;
using Velocit.RegularExssions;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Text
{
@@ -43,14 +44,14 @@ />
{
if (control == null)
{
- throw new ArgumentNullException("Cannot add a css class to a null control");
+ throw new ArgumentNullException("control", Resources.ArgumentNull_Generic);
}
if (newClass == null)
{
- throw new ArgumentNullException("Cannot add a null css class to a control");
+ throw new ArgumentNullException("newClass", Resources.ArgumentNull_String);
}
-
+
string existingClasses = control.CssClass;
if (String.IsNullOrEmpty(existingClasses))
{
@@ -79,13 +80,18 @@ />
{
if (control == null)
{
- throw new ArgumentNullException("Cannot remove a css class from a null control");
+ throw new ArgumentNullException("control", Resources.ArgumentNull_Generic);
}
if (classToRemove == null)
{
- throw new ArgumentNullException("Cannot remove a null css class from a control");
+ throw new ArgumentNullException("classToRemove", Resources.ArgumentNull_String);
}
+
+ if (classToRemove.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "classToRemove");
+ }
string existingClasses = control.CssClass;
if (String.IsNullOrEmpty(existingClasses))
@@ -95,14 +101,17 @@ />
string[] classes = existingClasses.Split(new string[] { " ", "\t", "\r\n", "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries);
string newClasses = String.Empty;
+ StringBuilder builder = new StringBuilder();
+
foreach (string cssClass in classes)
{
if (!String.Equals(cssClass, classToRemove, StringComparison.Ordinal))
{
- newClasses += cssClass + " ";
+ builder.AppendFormat("{0} ", cssClass);
}
}
+ newClasses = builder.ToString();
if (newClasses.EndsWith(" "))
{
newClasses = newClasses.Substring(0, newClasses.Length - 1);
@@ -167,7 +176,7 @@ />
reader.WhitespaceHandling = WhitespaceHandling.All;
reader.InputStream = new StringReader("<html>" + entry.Body + "</html>");
reader.CaseFolding = CaseFolding.ToLower;
- StringWriter writer = new StringWriter();
+ StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
XmlTextWriter xmlWriter = null;
try
{
@@ -238,8 +247,10 @@ />
/// <returns></returns>
public static string SafeFormat(string stringToTransform)
{
- if (stringToTransform == null)
- throw new ArgumentNullException("stringToTransform", "Cannot transform a null string.");
+ if (stringToTransform == null)
+ {
+ throw new ArgumentNullException("stringToTransform", Resources.ArgumentNull_String);
+ }
stringToTransform = HttpContext.Current.Server.HtmlEncode(stringToTransform);
string brTag = "<br />";
@@ -288,9 +299,16 @@ />
/// <returns></returns>
public static string ConvertToAllowedHtml(string text)
{
- if(text == null)
- throw new ArgumentNullException("text", "Cannot convert null to allowed html.");
+ if (text == null)
+ {
+ throw new ArgumentNullException("text", Resources.ArgumentNull_String);
+ }
+ if (text.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "text");
+ }
+
NameValueCollection allowedHtmlTags = Config.Settings.AllowedHtmlTags;
#if DEBUG
@@ -311,6 +329,11 @@ />
/// <returns></returns>
public static string ConvertToAllowedHtml(NameValueCollection allowedHtmlTags, string text)
{
+ if (text == null)
+ {
+ throw new ArgumentNullException("text", Resources.ArgumentNull_String);
+ }
+
if (allowedHtmlTags == null || allowedHtmlTags.Count == 0)
{
//This indicates that the AllowableCommentHtml configuration is either missing or
Modified: trunk/SubtextSolution/Subtext.Framework/Text/StringHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Text/StringHelper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Text/StringHelper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -18,6 +18,8 @@ />
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExssions;
+using System.Globalization;
+using Subtext.Framework.Properties;
// adapted from namespace Haack.Text
namespace Subtext.Framework.Text
@@ -91,7 +93,7 @@ />
public static string PascalCase(string text)
{
if(text == null)
- throw new ArgumentNullException("text", "Cannot PascalCase null text.");
+ throw new ArgumentNullException("text", Resources.ArgumentNull_String);
if(text.Length == 0)
return text;
@@ -102,7 +104,7 @@ />
if(words[i].Length > 0)
{
string word = words[i];
- char firstChar = char.ToUpper(word[0]);
+ char firstChar = char.ToUpper(word[0], CultureInfo.CurrentUICulture);
words[i] = firstChar + word.Substring(1);
}
}
@@ -142,10 +144,10 @@ />
public static string Right(string original, int length)
{
if(original == null)
- throw new ArgumentNullException("original", "Right cannot be evaluated on a null string.");
+ throw new ArgumentNullException("original", Resources.ArgumentNull_String);
if(length < 0)
- throw new ArgumentOutOfRangeException("length", length, "Length must not be negative.");
+ throw new ArgumentOutOfRangeException("length", length, Resources.ArgumnetOutOfRange_Length);
if(original.Length == 0 || length == 0)
return String.Empty;
@@ -185,9 +187,10 @@ />
public static string RightAfter(string original, string search, StringComparison comparisonType)
{
if(original == null)
- throw new ArgumentNullException("original", "The original string may not be null.");
+ throw new ArgumentNullException("original", Resources.ArgumentNull_String);
+
if(search == null)
- throw new ArgumentNullException("search", "The searchString string may not be null.");
+ throw new ArgumentNullException("search", Resources.ArgumentNull_String);
//Shortcut.
if(search.Length > original.Length || search.Length == 0)
@@ -230,10 +233,10 @@ />
public static string LeftBefore(string original, string search, StringComparison comparisonType)
{
if(original == null)
- throw new ArgumentNullException("original", "The original string may not be null.");
+ throw new ArgumentNullException("original", Resources.ArgumentNull_String);
if(search == null)
- throw new ArgumentNullException("search", "Search string may not be null.");
+ throw new ArgumentNullException("search", Resources.ArgumentNull_String);
//Shortcut.
if(search.Length > original.Length || search.Length == 0)
@@ -304,13 +307,13 @@ />
public static string Join<T>(string delimiter, IEnumerable<T> items, Converter<T, string> converter)
{
if (delimiter == null)
- throw new ArgumentNullException("delimiter", "Cannot join using a null delimiter.");
+ throw new ArgumentNullException("delimiter", Resources.ArgumentNull_String);
if (items == null)
- throw new ArgumentNullException("items", "Cannot join a null collection");
+ throw new ArgumentNullException("items", Resources.ArgumentNull_Collection);
if (converter == null)
- throw new ArgumentNullException("converter", "Cannot join using a null converter");
+ throw new ArgumentNullException("converter", Resources.ArgumentNull_Obj);
StringBuilder builder = new StringBuilder();
foreach (T item in items)
Modified: trunk/SubtextSolution/Subtext.Framework/Threading/Semaphore.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Threading/Semaphore.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Threading/Semaphore.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -1,5 +1,6 @@ />
using System;
using System.Threading;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Threading
{
@@ -23,7 +24,7 @@ />
/// <exception cref="ArgumentException">Throws if the count argument is less than 1.</exception>
public Semaphore(int count)
{
- if (count < 0) throw new ArgumentException("Semaphore must have a count of at least 0.", "count");
+ if (count < 0) throw new ArgumentException(Resources.Argument_SemaphoreCountLessThanZero, "count");
_count = count;
}
#endregion
Modified: trunk/SubtextSolution/Subtext.Framework/Threading/TimedLock.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Threading/TimedLock.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Threading/TimedLock.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -18,6 +18,7 @@ />
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Threading;
+using Subtext.Framework.Properties;
// Adapted from - namespace Haack.Threading
namespace Subtext.Framework.Threading
@@ -207,7 +208,7 @@ />
/// </summary>
/// <remarks>Use this exception.</remarks>
/// <param name="lockTarget">Object we tried to lock.</param>
- public LockTimeoutException(object lockTarget) : base("Timeout waiting for lock")
+ public LockTimeoutException(object lockTarget) : base(Resources.TimeoutWaitingForLock)
{
lock(_failedLockTargets)
{
@@ -226,7 +227,7 @@ />
public StackTrace GetBlockingStackTrace(int timeout)
{
if(timeout < 0)
- throw new InvalidOperationException("We'd all like to be able to go back in time, but this is not allowed. Please choose a positive wait time.");
+ throw new InvalidOperationException(Resources.InvalidOperation_WaitTimeLessThanZero);
ManualResetEvent waitHandle;
lock(_failedLockTargets)
@@ -249,7 +250,7 @@ />
/// <summary>
/// Creates a new <see cref="LockTimeoutException"/> instance.
/// </summary>
- public LockTimeoutException() : base("Timeout waiting for lock")
+ public LockTimeoutException() : base(Resources.TimeoutWaitingForLock)
{
}
Modified: trunk/SubtextSolution/Subtext.Framework/Tracking/TrackBackHandler.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Tracking/TrackBackHandler.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Tracking/TrackBackHandler.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -85,20 +85,25 @@ />
context.Response.ContentType = "text/xml";
int postId = 0 ;
- try
- {
- postId = WebPathStripper.GetEntryIDFromUrl(context.Request.Path);
- }
- catch(ArgumentException e)
- {
- Log.Info("Could not extract entry id from incoming URL." + e.Message, e);
- SendTrackbackResponse(context, 1, "EntryID is invalid or missing") ;
- }
+ try
+ {
+ postId = WebPathStripper.GetEntryIDFromUrl(context.Request.Path);
+ }
+ catch (ArgumentException e)
+ {
+ Log.Info("Could not extract entry id from incoming URL." + e.Message, e);
+ SendTrackbackResponse(context, TrackbackResponseCode.Error, "EntryID is invalid or missing");
+ }
+ catch (FormatException e)
+ {
+ Log.Info("Could not extract entry id from incoming URL." + e.Message, e);
+ SendTrackbackResponse(context, TrackbackResponseCode.Error, "EntryID is invalid or missing");
+ }
Entry entry = Entries.GetEntry(postId, PostConfig.IsActive, false);
if(entry == null)
{
- SendTrackbackResponse(context, 1, "EntryID is invalid or missing");
+ SendTrackbackResponse(context, TrackbackResponseCode.Error, "EntryID is invalid or missing");
return;
}
@@ -144,13 +149,13 @@ />
Uri url = HtmlHelper.ParseUri(urlText);
if(url == null)
{
- SendTrackbackResponse(context, 1, "no url parameter found, please try harder!");
+ SendTrackbackResponse(context, TrackbackResponseCode.Error, "no url parameter found, please try harder!");
return;
}
if (entry == null || !IsSourceVerification(url, entry.FullyQualifiedUrl))
{
- SendTrackbackResponse(context, 2, "Sorry couldn't find a relevant link in " + url );
+ SendTrackbackResponse(context, TrackbackResponseCode.Error, "Sorry couldn't find a relevant link in " + url);
return;
}
@@ -170,14 +175,14 @@ />
get { return true; }
}
- private static void SendTrackbackResponse(HttpContext context, int errorNumber, string errorMessage)
+ private static void SendTrackbackResponse(HttpContext context, TrackbackResponseCode errorNumber, string errorMessage)
{
XmlDocument d = new XmlDocument();
XmlElement root = d.CreateElement("response");
d.AppendChild(root) ;
XmlElement er = d.CreateElement("error");
root.AppendChild(er) ;
- er.AppendChild(d.CreateTextNode(errorNumber.ToString(CultureInfo.InvariantCulture)));
+ er.AppendChild(d.CreateTextNode(errorNumber.ToString()));
if (errorMessage.Length > 0)
{
XmlElement msg = d.CreateElement("message");
Modified: trunk/SubtextSolution/Subtext.Framework/Tracking/TrackHelpers.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Tracking/TrackHelpers.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Tracking/TrackHelpers.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -66,7 +66,7 @@ />
"trackback:ping=\"{3}services/trackbacks/{4}.aspx\" />" + nl +
"</rdf:RDF>" + nl +
"-->" + nl;
- return string.Format(tag, entry.FullyQualifiedUrl, entry.FullyQualifiedUrl, entry.Title, Config.CurrentBlog.RootUrl, entry.Id.ToString(CultureInfo.InvariantCulture));
+ return String.Format(CultureInfo.InvariantCulture, tag, entry.FullyQualifiedUrl, entry.FullyQualifiedUrl, entry.Title, Config.CurrentBlog.RootUrl, entry.Id.ToString(CultureInfo.InvariantCulture));
}
}
Added: trunk/SubtextSolution/Subtext.Framework/Tracking/TrackbackResponseCode.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Tracking/TrackbackResponseCode.cs (rev 0)
+++ trunk/SubtextSolution/Subtext.Framework/Tracking/TrackbackResponseCode.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -0,0 +1,54 @@ />
+#region Disclaimer/Info
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Subtext WebLog
+//
+// Subtext is an open source weblog system that is a fork of the .TEXT
+// weblog system.
+//
+// For updated news and information please visit http://subtextproject.com/
+// Subtext is hosted at SourceForge at http://sourceforge.net/projects/subtext
+// The development mailing list is at subtext-devs@lists.sourceforge.net
+//
+// This project is licensed under the BSD license. See the License.txt file for more information.
+///////////////////////////////////////////////////////////////////////////////////////////////////
+#endregion
+
+#region Notes
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ // The code in this file is freely distributable.
+ //
+ // ASPNetWeblog is not responsible for, shall have no liability for
+ // and disclaims all warranties whatsoever, exssed or implied, related to this code,
+ // including without limitation any warranties related to performance, security, stability,
+ // or non-infringement of title of the control.
+ //
+ // If you have any questions, comments or concerns, please contact
+ // Scott Watermasysk, Scott@TripleASP.Net. />
+ //
+ // For more information on this control, updates, and other tools to integrate blogging
+ // into your existing applications, please visit, http://aspnetweblog.com
+ //
+ // Based off of code by Simon Fell http://www.pocketsoap.com/weblog/
+ //
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+#endregion
+using System;
+
+namespace Subtext.Framework.Tracking
+{
+ /// <summary>
+ /// Defines the allowable Trackback response codes.
+ /// </summary>
+ public enum TrackbackResponseCode : int
+ {
+ /// <summary>
+ /// The trackback ping was succesful.
+ /// </summary>
+ Success = 0,
+
+ /// <summary>
+ /// The trackback ping was unsuccesful.
+ /// </summary>
+ Error = 1,
+ }
+}
\ No newline at end of file
Modified: trunk/SubtextSolution/Subtext.Framework/Tracking/TrackingUrls.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Tracking/TrackingUrls.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Tracking/TrackingUrls.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -14,6 +14,7 @@ />
#endregion
using System;
+using System.Globalization;
namespace Subtext.Framework.Tracking
{
@@ -25,7 +26,7 @@ />
private static readonly string ai = "<img src=\"{0}\" width=\"1\" height=\"1\" />";
public static string AggBugImage(string url)
{
- return string.Format(ai,url);
+ return String.Format(CultureInfo.InvariantCulture, ai, url);
}
}
Modified: trunk/SubtextSolution/Subtext.Framework/UrlManager/HandlerConfiguration.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/UrlManager/HandlerConfiguration.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/UrlManager/HandlerConfiguration.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -17,6 +17,7 @@ />
using System.Configuration;
using System.Web;
using System.Xml.Serialization;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.UrlManager
{
@@ -33,7 +34,12 @@ />
/// <param name="controls">Controls.</param>
public static void SetControls(HttpContext context, string[] controls)
{
- if(controls != null)
+ if (context == null)
+ {
+ throw new ArgumentNullException("context", Resources.ArgumentNull_Generic);
+ }
+
+ if (controls != null)
{
context.Items.Add("Subtext.Framework.UrlManager.ControlContext", controls);
}
@@ -43,11 +49,16 @@ />
/// Gets the controls associated to the specified context.
/// </summary>
/// <param name="context">Context.</param>
- public static string[] GetControls(HttpContext context)
- {
- return (string[])context.Items["Subtext.Framework.UrlManager.ControlContext"];
- }
+ public static string[] GetControls(HttpContext context)
+ {
+ if (context == null)
+ {
+ throw new ArgumentNullException("context", Resources.ArgumentNull_Generic);
+ }
+ return (string[])context.Items["Subtext.Framework.UrlManager.ControlContext"];
+ }
+
private HttpHandler[] _httpHandlers;
/// <summary>
/// Gets or sets the HTTP handlers configured in the HttpHandlers section.
Modified: trunk/SubtextSolution/Subtext.Framework/UrlManager/UrlReWriteHandlerFactory.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/UrlManager/UrlReWriteHandlerFactory.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/UrlManager/UrlReWriteHandlerFactory.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -20,6 +20,7 @@ />
using Subtext.Framework;
using Subtext.Framework.Configuration;
using Subtext.Framework.Text;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.UrlManager
{
@@ -56,6 +57,41 @@ />
/// </returns>
public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string url, string path)
{
+ if (context == null)
+ {
+ throw new ArgumentNullException("context", Resources.ArgumentNull_Generic);
+ }
+
+ if (requestType == null)
+ {
+ throw new ArgumentNullException("requestType", Resources.ArgumentNull_String);
+ }
+
+ if (url == null)
+ {
+ throw new ArgumentNullException("url", Resources.ArgumentNull_String);
+ }
+
+ if (path == null)
+ {
+ throw new ArgumentNullException("path", Resources.ArgumentNull_String);
+ }
+
+ if (requestType.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "requestType");
+ }
+
+ if (url.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "url");
+ }
+
+ if (path.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "path");
+ }
+
if (IsRequestForAggregateBlog && !InstallationManager.IsOnLoginPage) //This line calls the db.
{
string handlerUrl = context.Request.ApplicationPath;
@@ -95,7 +131,7 @@ />
return ProcessHandlerTypeDirectory(context, url);
default:
- throw new Exception("Invalid HandlerType: Unknown");
+ throw new Exception(Resources.ApplicationException_UnknownHandlerType);
}
}
}
Modified: trunk/SubtextSolution/Subtext.Framework/Util/TimeZones.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Util/TimeZones.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Util/TimeZones.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -239,7 +239,7 @@ />
current = start = new DateTime( year, winTZI.daylightDate.month, 1, winTZI.daylightDate.hour,winTZI.daylightDate.minute,winTZI.daylightDate.second );
while ( current.Month == winTZI.daylightDate.month )
{
- if ( Convert.ToUInt16(current.DayOfWeek) == winTZI.daylightDate.dayOfWeek )
+ if ( Convert.ToUInt16(current.DayOfWeek, NumberFormatInfo.InvariantInfo) == winTZI.daylightDate.dayOfWeek )
{
start = current;
--dayCount;
@@ -257,7 +257,7 @@ />
current = end = new DateTime( year, winTZI.standardDate.month, 1, winTZI.standardDate.hour,winTZI.standardDate.minute,winTZI.standardDate.second );
while ( current.Month == winTZI.standardDate.month )
{
- if ( Convert.ToUInt16(current.DayOfWeek) == winTZI.standardDate.dayOfWeek )
+ if ( Convert.ToUInt16(current.DayOfWeek, NumberFormatInfo.InvariantInfo) == winTZI.standardDate.dayOfWeek )
{
end = current;
--dayCount;
Modified: trunk/SubtextSolution/Subtext.Framework/Util/Transform.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Util/Transform.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Util/Transform.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -22,6 +22,8 @@ />
using log4net;
using Subtext.Framework.Logging;
using Subtext.Framework.Configuration;
+using System.Globalization;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Util
{
@@ -63,7 +65,7 @@ />
while (iLoop < userDefinedTransforms.Count)
{
// Special work for anchors
- stringToTransform = Regex.Replace(stringToTransform, userDefinedTransforms[iLoop].ToString(), string.Format(userDefinedTransforms[iLoop+1].ToString(),host), RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Multiline);
+ stringToTransform = Regex.Replace(stringToTransform, userDefinedTransforms[iLoop].ToString(), String.Format(CultureInfo.InvariantCulture, userDefinedTransforms[iLoop+1].ToString(),host), RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Multiline);
iLoop += 2;
}
@@ -74,7 +76,15 @@ />
private static ArrayList LoadTransformFile(string filename)
{
if (filename == null)
- throw new ArgumentNullException("filename", "The transform filename is null.");
+ {
+ throw new ArgumentNullException("filename", Resources.ArgumentNull_String);
+ }
+
+ if (filename.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "filename");
+ }
+
string cacheKey = "transformTable-" + filename;
ArrayList tranforms;
string filenameOfTransformFile;
Modified: trunk/SubtextSolution/Subtext.Framework/Util/WebPathStripper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Util/WebPathStripper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Util/WebPathStripper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -17,6 +17,7 @@ />
using System.Globalization;
using System.IO;
using System.Text.RegularExssions;
+using Subtext.Framework.Properties;
//This might need to somehow be provider based. Or even Globalized. Not all dates will be US :)
@@ -91,17 +92,17 @@ />
/// <returns></returns>
public static int GetEntryIDFromUrl(string url)
{
- if(url == null)
- throw new ArgumentNullException("uri", "Cannot get entry id from a null url.");
-
- try
- {
- return Int32.Parse(Path.GetFileNameWithoutExtension(url));
- }
- catch(System.FormatException e)
- {
- throw new ArgumentException("The specified URL does not contain an entry id.", "url", e);
- }
+ if (url == null)
+ {
+ throw new ArgumentNullException("url", Resources.ArgumentNull_String);
+ }
+
+ if (url.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "url");
+ }
+
+ return Int32.Parse(Path.GetFileNameWithoutExtension(url));
}
}
}
Modified: trunk/SubtextSolution/Subtext.Framework/Web/Handlers/RsdHandler.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Web/Handlers/RsdHandler.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Web/Handlers/RsdHandler.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -5,6 +5,7 @@ />
using System.Xml;
using Subtext.Extensibility.Web;
using Subtext.Framework.Configuration;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Web.Handlers
{
@@ -46,6 +47,11 @@ />
/// <param name="context">Context.</param>
public override void HandleRequest(HttpContext context)
{
+ if (context == null)
+ {
+ throw new ArgumentNullException("context", Resources.ArgumentNull_Generic);
+ }
+
if(Config.CurrentBlog == null)
return;
@@ -66,7 +72,17 @@ />
/// <param name="blog"></param>
public static void WriteRsd(XmlWriter writer, BlogInfo blog)
{
- writer.WriteStartDocument();
+ if (writer == null)
+ {
+ throw new ArgumentNullException("writer", Resources.ArgumentNull_Generic);
+ }
+
+ if (blog == null)
+ {
+ throw new ArgumentNullException("blog", Resources.ArgumentNull_Generic);
+ }
+
+ writer.WriteStartDocument();
writer.WriteStartElement("rsd", "" target="_blank">http://archipelago.phrasewise.com/rsd");
writer.WriteAttributeString("version", "1.0");
writer.WriteStartElement("service");
Modified: trunk/SubtextSolution/Subtext.Framework/Web/HttpHelper.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Web/HttpHelper.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Web/HttpHelper.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -5,6 +5,7 @@ />
using System.Text;
using System.Web;
using Subtext.Framework.Text;
+using Subtext.Framework.Properties;
namespace Subtext.Framework.Web
{
@@ -175,6 +176,11 @@ />
/// <param name="request"></param>
public static void SetProxy(WebRequest request)
{
+ if (request == null)
+ {
+ throw new ArgumentNullException(Resources.ArgumentNull_Generic);
+ }
+
IWebProxy proxy = GetProxy();
if(proxy != null)
request.Proxy = proxy;
Modified: trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/AuthenticationModule.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/AuthenticationModule.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/AuthenticationModule.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -6,6 +6,7 @@ />
using Subtext.Framework.Logging;
using Subtext.Framework.Web;
using Subtext.Framework.Security;
+using Subtext.Framework.Properties;
namespace Subtext.Web.HttpModules
{
@@ -19,13 +20,18 @@ />
public void Init(HttpApplication context)
{
+ if (context == null)
+ {
+ throw new ArgumentNullException(Resources.ArgumentNull_Generic);
+ }
+
context.AuthenticateRequest += OnAuthenticateRequest;
context.PostAuthenticateRequest += OnPostAuthenticateRequest;
}
void OnPostAuthenticateRequest(object sender, EventArgs e)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new Exception(Resources.NotImplementedException_Generic);
}
void OnAuthenticateRequest(object sender, EventArgs e)
Modified: trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/BlogRequestModule.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/BlogRequestModule.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/BlogRequestModule.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -5,6 +5,7 @@ />
using Subtext.Framework.Format;
using Subtext.Framework.Text;
using Subtext.Framework.Web.HttpModules;
+using Subtext.Framework.Properties;
namespace Subtext.Web.HttpModules
{
@@ -28,6 +29,11 @@ />
/// <param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application</param>
public void Init(HttpApplication context)
{
+ if (context == null)
+ {
+ throw new ArgumentNullException(Resources.ArgumentNull_Generic);
+ }
+
context.BeginRequest += MapUrlToBlogStatus;
}
Modified: trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/InstallationCheckModule.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/InstallationCheckModule.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/Web/HttpModules/InstallationCheckModule.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -7,6 +7,7 @@ />
using Subtext.Framework.Threading;
using Subtext.Framework.Web;
using Subtext.Installation;
+using Subtext.Framework.Properties;
namespace Subtext.Web.HttpModules
{
@@ -34,6 +35,11 @@ />
/// and events common to all application objects within an ASP.NET application</param>
public void Init(System.Web.HttpApplication context)
{
+ if (context == null)
+ {
+ throw new ArgumentNullException(Resources.ArgumentNull_Generic);
+ }
+
context.BeginRequest += CheckInstallationStatus;
}
Modified: trunk/SubtextSolution/Subtext.Framework/XmlRpc/MetaWeblog.cs
===================================================================
--- trunk/SubtextSolution/Subtext.Framework/XmlRpc/MetaWeblog.cs 2006-12-16 22:20:34 UTC (rev 2155)
+++ trunk/SubtextSolution/Subtext.Framework/XmlRpc/MetaWeblog.cs 2006-12-17 20:12:47 UTC (rev 2156)
@@ -23,6 +23,7 @@ />
using Subtext.Extensibility;
using Subtext.Framework.Components;
using Subtext.Framework.Configuration;
+using Subtext.Framework.Properties;
//Need to find a method that has access to context, so we can terminate the request if AllowServiceAccess == false.
//Users will be able to access the metablogapi page, but will not be able to make a request, but the page should not be visible
@@ -70,7 +71,7 @@ />
try
{
- Entries.Delete(Int32.Parse(postid));
+ Entries.Delete(Int32.Parse(postid, NumberFormatInfo.InvariantInfo));
return true;
}
catch
@@ -86,7 +87,7 @@ />
Framework.BlogInfo info = Config.CurrentBlog;
ValidateUser(username,password,info.AllowServiceAccess);
- Entry entry = Entries.GetEntry(Int32.Parse(postid), PostConfig.None, true);
+ Entry entry = Entries.GetEntry(Int32.Parse(postid, NumberFormatInfo.InvariantInfo), PostConfig.None, true);
if(entry != null)
{
MembershipUser author = Membership.GetUser(username);
@@ -113,7 +114,7 @@ />
Framework.BlogInfo info = Config.CurrentBlog;
ValidateUser(username,password,info.AllowServiceAccess);
- Entry entry = Entries.GetEntry(Int32.Parse(postid), PostConfig.None, true);
+ Entry entry = Entries.GetEntry(Int32.Parse(postid, NumberFormatInfo.InvariantInfo), PostConfig.None, true);
Post post = new Post();
post.link = entry.Url;
post.description = entry.Body;
@@ -382,18 +383,53 @@ />
public bool SetPostCategories(string postid, string username, string password,
MtCategory[] categories)
{
- ValidateUser(username,password,Config.CurrentBlog.AllowServiceAccess);
+ if (postid == null)
+ {
+ throw new ArgumentNullException("postid", Resources.ArgumentNull_String);
+ }
+
+ if (username == null)
+ {
+ throw new ArgumentNullException("username", Resources.ArgumentNull_String);
+ }
+
+ if (password == null)
+ {
+ throw new ArgumentNullException("password", Resources.ArgumentNull_String);
+ }
+
+ if (postid.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "postid");
+ }
+
+ if (username.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "username");
+ }
+
+ if (password.Length == 0)
+ {
+ throw new ArgumentException(Resources.Argument_StringZeroLength, "password");
+ }
+
+ if (categories == null)
+ {
+ throw new ArgumentNullException("categories", Resources.ArgumentNull_Array);
+ }
+
+ ValidateUser(username, password, Config.CurrentBlog.AllowServiceAccess);
if (categories != null && categories.Length > 0)
{
- int postID = Int32.Parse(postid);
+ int postID = Int32.Parse(postid, NumberFormatInfo.InvariantInfo);
ArrayList al = new ArrayList();
for (int i = 0; i < categories.Length; i++)
{
- al.Add(Int32.Parse(categories[i].categoryId));
+ al.Add(Int32.Parse(categories[i].categoryId, NumberFormatInfo.InvariantInfo));
}
if(al.Count > 0)
@@ -411,7 +447,7 @@ />
{
ValidateUser(username, password, Config.CurrentBlog.AllowServiceAccess);
- int postID = Int32.Parse(postid);
+ int postID = Int32.Parse(postid, NumberFormatInfo.InvariantInfo);
ICollection<Link> postCategories = Links.GetLinkCollectionByPostID(postID);
MtCategory[] categories = new MtCategory[postCategories.Count];
if (postCategories.Count > 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|