From: <us...@us...> - 2006-08-28 02:18:24
|
Revision: 1728 Author: ussherm Date: 2006-08-27 19:18:05 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/subtext/?rev=1728&view=rev Log Message: ----------- Merging version 1722-1727 changes from the 1.9 Branch into TRUNK Modified Paths: -------------- trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs trunk/SubtextSolution/Subtext.Framework/Entries.cs trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs trunk/SubtextSolution/Subtext.Framework/ImportManager.cs trunk/SubtextSolution/Subtext.Providers.BlogEntryEditor.FCKeditor/FckBlogEntryEditorProvider.cs trunk/SubtextSolution/Subtext.Scripting/Script.cs trunk/SubtextSolution/Subtext.Web/Admin/EditGalleries.aspx.cs trunk/SubtextSolution/Subtext.Web/Admin/WebUI/Components/OpmlProvider.cs trunk/SubtextSolution/Subtext.Web/MainFeed.aspx.cs trunk/SubtextSolution/Subtext.Web/OPML.aspx.cs trunk/SubtextSolution/Subtext.Web/Providers/BlogEntryEditor/FTB/FtbBlogEntryEditorProvider.cs trunk/SubtextSolution/Subtext.Web/UI/Controls/RelatedLinks.cs trunk/SubtextSolution/Subtext.Web/UI/Controls/SubtextSearch.cs trunk/SubtextSolution/Subtext.Web/UI/Controls/Top10Module.cs trunk/SubtextSolution/Subtext.Web.Controls/ConnectionStringBuilder.cs Modified: trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs =================================================================== --- trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Framework/CommentFilter.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -68,7 +68,7 @@ static bool ContainsSpam(Entry entry) { string spamWordsText = System.Configuration.ConfigurationManager.AppSettings["SpamWords"]; - if(spamWordsText != null && spamWordsText.Length > 0) + if(!string.IsNullOrEmpty(spamWordsText)) { string[] spamWords = spamWordsText.Split(' '); foreach(string spamWord in spamWords) @@ -78,8 +78,8 @@ //spam puts casino in title. if(regex.IsMatch(entry.Title) - || (entry.Author != null && regex.IsMatch(entry.Author)) - || (entry.TitleUrl != null && regex.IsMatch(entry.TitleUrl))) + || (!string.IsNullOrEmpty(entry.Author) && regex.IsMatch(entry.Author)) + || (!string.IsNullOrEmpty(entry.TitleUrl) && regex.IsMatch(entry.TitleUrl))) { AddToBlackList(entry); return true; Modified: trunk/SubtextSolution/Subtext.Framework/Entries.cs =================================================================== --- trunk/SubtextSolution/Subtext.Framework/Entries.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Framework/Entries.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -321,7 +321,7 @@ return AutoGenerateFriendlyUrl(title, char.MinValue); } - string wordSeparator = friendlyUrlSettings["separatingCharacter"];; + string wordSeparator = friendlyUrlSettings["separatingCharacter"]; int wordCount; if (friendlyUrlSettings["limitWordCount"] == null) @@ -526,7 +526,7 @@ comment.NeedsModeratorApproval = !comment.IsActive; comment.DateCreated = comment.DateUpdated = BlogTime.CurrentBloggerTime; - if (null == comment.SourceName || String.Empty == comment.SourceName) + if (String.IsNullOrEmpty(comment.SourceName)) comment.SourceName = "N/A"; // insert comment into backend, save the returned entryid for permalink anchor below @@ -560,7 +560,7 @@ string To = Config.CurrentBlog.Email; string From = fromEmail; - string Subject = string.Format(CultureInfo.InvariantCulture, "Comment: {0} (via {1})", comment.Title, blogTitle); + string Subject = String.Format(CultureInfo.InvariantCulture, "Comment: {0} (via {1})", comment.Title, blogTitle); string bodyFormat = "Comment from {0}" + Environment.NewLine + "----------------------------------------------------" + Environment.NewLine Modified: trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs =================================================================== --- trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Framework/Format/UrlFormats.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -288,7 +288,7 @@ //we can pass in a string builder. String app = Config.CurrentBlog.Subfolder; - string url = (app.Equals(String.Empty)) ? "~" : "~/" + app; + string url = (String.IsNullOrEmpty(app)) ? "~" : "~/" + app; if(entry.PostType == PostType.BlogPost) url += "/Admin/EditPosts.aspx?PostID=" + entry.Id; else if(entry.PostType == PostType.Story) Modified: trunk/SubtextSolution/Subtext.Framework/ImportManager.cs =================================================================== --- trunk/SubtextSolution/Subtext.Framework/ImportManager.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Framework/ImportManager.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -61,8 +61,7 @@ provider.Import(populatedControl); IPagedCollection<BlogInfo> blogs; - ObjectProvider objProvider = ObjectProvider.Instance(); - + int totalBlogCount = Config.BlogCount; const int pageSize = 100; int pages = totalBlogCount/pageSize; Modified: trunk/SubtextSolution/Subtext.Providers.BlogEntryEditor.FCKeditor/FckBlogEntryEditorProvider.cs =================================================================== --- trunk/SubtextSolution/Subtext.Providers.BlogEntryEditor.FCKeditor/FckBlogEntryEditorProvider.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Providers.BlogEntryEditor.FCKeditor/FckBlogEntryEditorProvider.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -121,8 +121,7 @@ _fckCtl.SkinPath = _fckCtl.BasePath + "editor/skins/" + _skin + "/"; // Compute user image gallery url - string blogImageRootPath=Subtext.Framework.Format.UrlFormats.StripHostFromUrl(Subtext.Framework.Configuration.Config.CurrentBlog.ImagePath); - string blogSubFolder = Subtext.Framework.Configuration.Config.CurrentBlog.Subfolder; + string blogSubFolder = Subtext.Framework.Configuration.Config.CurrentBlog.Subfolder; string currentImageConnector = _imageConnectorURL; string currentLinkConnector = _linkConnectorURL; if (blogSubFolder.Length > 0) Modified: trunk/SubtextSolution/Subtext.Scripting/Script.cs =================================================================== --- trunk/SubtextSolution/Subtext.Scripting/Script.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Scripting/Script.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -44,7 +44,7 @@ ScriptCollection scripts = new ScriptCollection(fullScriptText); foreach(string scriptText in scriptTexts) { - if(scriptText.Trim() != string.Empty) + if (!String.IsNullOrEmpty(scriptText.Trim())) { scripts.Add(new Script(scriptText)); } Modified: trunk/SubtextSolution/Subtext.Web/Admin/EditGalleries.aspx.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/Admin/EditGalleries.aspx.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/Admin/EditGalleries.aspx.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -263,7 +263,7 @@ string fileName = Path.GetFileName(theEntry.Name); // TODO: Filter for image types? - if (fileName != String.Empty) + if (!String.IsNullOrEmpty(fileName)) { image = new Subtext.Framework.Components.Image(); image.CategoryID = CategoryID; Modified: trunk/SubtextSolution/Subtext.Web/Admin/WebUI/Components/OpmlProvider.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/Admin/WebUI/Components/OpmlProvider.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/Admin/WebUI/Components/OpmlProvider.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -137,21 +137,20 @@ if (nav.HasAttributes) { string title = nav.GetAttribute("title", ""); - if (String.Empty == title) + if (String.IsNullOrEmpty(title)) title = nav.GetAttribute("text", ""); - - string description = nav.GetAttribute("description", ""); - + string htmlUrl = nav.GetAttribute("htmlurl", ""); - if (String.Empty == htmlUrl) - htmlUrl = nav.GetAttribute("htmlUrl", ""); + if (String.IsNullOrEmpty(htmlUrl)) + htmlUrl = nav.GetAttribute("htmlUrl", ""); string xmlUrl = nav.GetAttribute("xmlurl", ""); - if (String.Empty == xmlUrl) + if (String.IsNullOrEmpty(xmlUrl)) xmlUrl = nav.GetAttribute("xmlUrl", ""); OpmlItem currentItem = null; - if (String.Empty != title && String.Empty != htmlUrl) + string description = nav.GetAttribute("description", ""); + if (!String.IsNullOrEmpty(title) && !String.IsNullOrEmpty(htmlUrl)) currentItem = new OpmlItem(title, description, xmlUrl, htmlUrl); if (null != currentItem) Modified: trunk/SubtextSolution/Subtext.Web/MainFeed.aspx.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/MainFeed.aspx.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/MainFeed.aspx.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -151,7 +151,7 @@ } catch(Exception e) { - throw e; + throw; } } Modified: trunk/SubtextSolution/Subtext.Web/OPML.aspx.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/OPML.aspx.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/OPML.aspx.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -105,7 +105,7 @@ } catch(Exception e) { - throw e; + throw; } Modified: trunk/SubtextSolution/Subtext.Web/Providers/BlogEntryEditor/FTB/FtbBlogEntryEditorProvider.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/Providers/BlogEntryEditor/FTB/FtbBlogEntryEditorProvider.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/Providers/BlogEntryEditor/FTB/FtbBlogEntryEditorProvider.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -91,8 +91,6 @@ string blogImageRootPath=Subtext.Framework.Format.UrlFormats.StripHostFromUrl(Subtext.Framework.Configuration.Config.CurrentBlog.ImagePath); - string phisicalImageRootPath=HttpContext.Current.Server.MapPath(blogImageRootPath); - _ftbCtl.ImageGalleryPath=blogImageRootPath; } Modified: trunk/SubtextSolution/Subtext.Web/UI/Controls/RelatedLinks.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/UI/Controls/RelatedLinks.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/UI/Controls/RelatedLinks.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -1,17 +1,16 @@ using System; +using System.Collections; +using System.Data; +using System.Data.SqlClient; +using System.Web.UI.WebControls; +using Subtext.Framework; +using Subtext.Framework.Components; +using Subtext.Framework.Data; +using Subtext.Framework.Providers; namespace Subtext.Web.UI.Controls { - using System.Collections; - using System.Configuration; - using System.Data; - using System.Data.SqlClient; - using System.Web.UI.WebControls; - using Subtext.Framework.Data; - using Subtext.Framework; - using Subtext.Framework.Components; - using Subtext.Framework.Providers; - /// <summary> + /// <summary> /// Summary description for RelatedLinks. /// </summary> public class RelatedLinks : BaseControl @@ -25,7 +24,6 @@ ArrayList myRelLinks = new ArrayList(); int BlogId; - string applikasyon; //fix for the blogs where only one installed if (CurrentBlog.Id >= 1) @@ -33,11 +31,6 @@ else BlogId = 0; - if (CurrentBlog.Subfolder != String.Empty) - applikasyon = CurrentBlog.Subfolder; - else - applikasyon = String.Empty; - Entry entry = Cacher.GetEntryFromRequest(CacheDuration.Short); int entryid = entry.Id; Modified: trunk/SubtextSolution/Subtext.Web/UI/Controls/SubtextSearch.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/UI/Controls/SubtextSearch.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/UI/Controls/SubtextSearch.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -65,7 +65,7 @@ public void btnSearch_Click(object sender, EventArgs e) { - if(string.Empty != txtSearch.Text) + if (!String.IsNullOrEmpty(txtSearch.Text)) { //fix for the blogs where only one installed int blogId = 0; Modified: trunk/SubtextSolution/Subtext.Web/UI/Controls/Top10Module.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/UI/Controls/Top10Module.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web/UI/Controls/Top10Module.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -33,8 +33,6 @@ else BlogId = 0; - string application = CurrentBlog.Subfolder; - SqlParameter[] p = { DataHelper.MakeInParam("@BlogID", SqlDbType.Int, 4, BlogId) @@ -86,4 +84,4 @@ get { return URL; } } } -} \ No newline at end of file +} Modified: trunk/SubtextSolution/Subtext.Web.Controls/ConnectionStringBuilder.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web.Controls/ConnectionStringBuilder.cs 2006-08-28 01:07:48 UTC (rev 1727) +++ trunk/SubtextSolution/Subtext.Web.Controls/ConnectionStringBuilder.cs 2006-08-28 02:18:05 UTC (rev 1728) @@ -14,14 +14,17 @@ #endregion using System; +using System.Collections; using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.Data.SqlClient; +using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; +using SQLDMO; using Subtext.Scripting; -using System.Collections; -using System.Data; -using System.Data.SqlClient; namespace Subtext.Web.Controls { @@ -46,18 +49,18 @@ const string RefreshDatabaseControlId = "lnkBtnConnectionStringBuilderRefreshDatabase"; const string ConnectionResultControlId = "lblConnectionStringBuilderConnectionResult"; - protected System.Web.UI.WebControls.DropDownList machineName=new DropDownList(); - protected System.Web.UI.WebControls.TextBox otherMachineName=new TextBox(); - protected System.Web.UI.WebControls.RadioButtonList authMode=new RadioButtonList(); - protected System.Web.UI.WebControls.TextBox username=new TextBox(); - protected System.Web.UI.WebControls.DropDownList databaseName= new DropDownList(); - protected System.Web.UI.WebControls.Button testConnection=new Button(); - protected System.Web.UI.WebControls.TextBox password=new TextBox(); - protected System.Web.UI.WebControls.Label connResult=new Label(); - protected System.Web.UI.WebControls.LinkButton refreshDatabase=new LinkButton(); + protected DropDownList machineName=new DropDownList(); + protected TextBox otherMachineName=new TextBox(); + protected RadioButtonList authMode=new RadioButtonList(); + protected TextBox username=new TextBox(); + protected DropDownList databaseName= new DropDownList(); + protected Button testConnection=new Button(); + protected TextBox password=new TextBox(); + protected Label connResult=new Label(); + protected LinkButton refreshDatabase=new LinkButton(); - private ConnectionString _connStr=Subtext.Scripting.ConnectionString.Empty; + private ConnectionString _connStr=Scripting.ConnectionString.Empty; override protected void OnInit(EventArgs e) @@ -68,9 +71,9 @@ private void InitializeComponent() { - authMode.SelectedIndexChanged += new System.EventHandler(this.authMode_SelectedIndexChanged); - testConnection.Click += new System.EventHandler(this.testConnection_Click); - refreshDatabase.Click += new System.EventHandler(this.refreshDatabase_Click); + authMode.SelectedIndexChanged += new EventHandler(this.authMode_SelectedIndexChanged); + testConnection.Click += new EventHandler(this.testConnection_Click); + refreshDatabase.Click += new EventHandler(this.refreshDatabase_Click); } /// <summary> @@ -112,7 +115,7 @@ row.VAlign = "top"; HtmlTableCell questionCell = new HtmlTableCell(); - if(CheckSQLDMO()) + if (CheckSQLDMO()) { //Build advanced control HtmlTable connBuilderTable=BuildAdvancedBuilder(); @@ -128,7 +131,7 @@ row.Cells.Add(questionCell); //Checkbox to use connection string in web.config - if(AllowWebConfigOverride) + if (AllowWebConfigOverride) { CheckBox checkbox = new CheckBox(); checkbox.ID = CheckboxControlId; @@ -148,7 +151,7 @@ table.Rows.Add(row); this.Controls.Add(table); - if(CheckSQLDMO()) + if (CheckSQLDMO()) { LoadData(); } @@ -160,9 +163,9 @@ { try { - new SQLDMO.ApplicationClass(); + new ApplicationClass(); } - catch(System.Runtime.InteropServices.COMException) + catch(COMException) { return false; } @@ -322,16 +325,16 @@ private void PopulateServerNameCmb() { ArrayList serverNames = new ArrayList(); - SQLDMO.Application dmo = new SQLDMO.ApplicationClass(); + Application dmo = new ApplicationClass(); try { - SQLDMO.NameList instances = dmo.ListAvailableSQLServers(); + NameList instances = dmo.ListAvailableSQLServers(); foreach(string instance in instances) { serverNames.Add(instance); } } - catch(System.InvalidCastException) + catch(InvalidCastException) { serverNames.Add("localhost"); } @@ -345,24 +348,24 @@ private void PopulateDatabaseNamesCmb() { ArrayList dbNames = new ArrayList(); - SQLDMO.SQLServer sqlInstance = new SQLDMO.SQLServerClass(); + SQLServer sqlInstance = new SQLServerClass(); try { - if(_connStr.TrustedConnection) + if (_connStr.TrustedConnection) { sqlInstance.LoginSecure=true; sqlInstance.Connect(_connStr.Server,null,null); } else sqlInstance.Connect(_connStr.Server,_connStr.UserId,_connStr.Password); - foreach(SQLDMO.Database db in sqlInstance.Databases) + foreach(Database db in sqlInstance.Databases) { dbNames.Add(db.Name); } databaseName.DataSource=dbNames; databaseName.DataBind(); - if(databaseName.Items.FindByValue(_connStr.Database)!=null) + if (databaseName.Items.FindByValue(_connStr.Database)!=null) databaseName.SelectedValue=_connStr.Database; } catch(Exception) @@ -381,13 +384,13 @@ private void SetConnectionString() { _connStr.TrustedConnection = authMode.SelectedValue.Equals("win"); - if(otherMachineName.Text.Trim().Equals("")) + if (String.IsNullOrEmpty(otherMachineName.Text.Trim())) _connStr.Server = machineName.SelectedValue; else _connStr.Server = otherMachineName.Text; _connStr.Database = databaseName.SelectedValue; - if(!_connStr.TrustedConnection) + if (!_connStr.TrustedConnection) { _connStr.UserId = username.Text; _connStr.Password = password.Text; @@ -399,36 +402,36 @@ } } - private void authMode_SelectedIndexChanged(object sender, System.EventArgs e) + private void authMode_SelectedIndexChanged(object sender, EventArgs e) { - if(authMode.SelectedValue.Equals("win")) + if (authMode.SelectedValue.Equals("win")) { username.Enabled=false; password.Enabled=false; SetConnectionString(); PopulateDatabaseNamesCmb(); } - else if(authMode.SelectedValue.Equals("sql")) + else if (authMode.SelectedValue.Equals("sql")) { username.Enabled=true; password.Enabled=true; username.Text=_connStr.UserId; password.Text=_connStr.Password; - if(!username.Text.Trim().Equals(String.Empty)) + if (!String.IsNullOrEmpty(username.Text.Trim())) { PopulateDatabaseNamesCmb(); } } } - private void refreshDatabase_Click(object sender, System.EventArgs e) + private void refreshDatabase_Click(object sender, EventArgs e) { SetConnectionString(); connResult.Text=""; PopulateDatabaseNamesCmb(); } - private void testConnection_Click(object sender, System.EventArgs e) + private void testConnection_Click(object sender, EventArgs e) { try { @@ -436,7 +439,7 @@ using(SqlConnection conn = new SqlConnection(ConnectionString)) { conn.Open(); - if(conn.State == ConnectionState.Open) + if (conn.State == ConnectionState.Open) { connResult.Text="Connection Succeded"; return; @@ -465,7 +468,7 @@ { get { - if(ViewState["AllowWebConfigOverride"] != null) + if (ViewState["AllowWebConfigOverride"] != null) return (bool)ViewState["AllowWebConfigOverride"]; return false; } @@ -487,9 +490,9 @@ { get { - if(UseWebConfigCheckBox != null && UseWebConfigCheckBox.Checked) - return System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]; - if(CheckSQLDMO()) + if (UseWebConfigCheckBox != null && UseWebConfigCheckBox.Checked) + return ConfigurationManager.AppSettings["ConnectionString"]; + if (CheckSQLDMO()) { SetConnectionString(); return _connStr.ToString(); @@ -499,8 +502,8 @@ } set { - _connStr = Subtext.Scripting.ConnectionString.Parse(value); - if(ConnectionStringTextBox != null) + _connStr = Scripting.ConnectionString.Parse(value); + if (ConnectionStringTextBox != null) ConnectionStringTextBox.Text = value; } } @@ -517,7 +520,7 @@ { get { - if(ViewState["Title"] != null) + if (ViewState["Title"] != null) return ViewState["Title"] as string; return string.Empty; } @@ -539,7 +542,7 @@ { get { - if(ViewState["Description"] != null) + if (ViewState["Description"] != null) return ViewState["Description"] as string; return string.Empty; } @@ -593,17 +596,17 @@ { Page.Trace.Write("onLoad"); connResult.Text=""; - if(!Page.IsPostBack) + if (!Page.IsPostBack) { PopulateServerNameCmb(); - if(_connStr!=null) + if (_connStr!=null) { - if(machineName.Items.FindByValue(_connStr.Server)!=null) + if (machineName.Items.FindByValue(_connStr.Server)!=null) machineName.SelectedValue=_connStr.Server; else otherMachineName.Text=_connStr.Server; - if(_connStr.TrustedConnection) + if (_connStr.TrustedConnection) { authMode.SelectedValue="win"; username.Enabled=false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |