温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:LiveBlog v1.0测试版源码
当前文件:
LiveBlog/LiveBlog.Core/BlogSettings.cs,打开代码结构图
LiveBlog/LiveBlog.Core/BlogSettings.cs,打开代码结构图1Using#region Using 2
3
using System; 4
using System.ComponentModel; 5
using System.Configuration; 6
using System.Globalization; 7
using System.IO; 8
using System.Reflection; 9
using System.Web; 10
11
#endregion 12
//51aspx.com 13
namespace LiveBlog.Core 14
...{ 15
/**//// <summary> 16
/// Represents the configured settings for the blog engine. 17
/// </summary> 18
public class BlogSettings 19
...{ 20
//============================================================ 21
// PUBLIC/PRIVATE/PROTECTED MEMBERS 22
//============================================================ 23
PRIVATE/PROTECTED/PUBLIC MEMBERS#region PRIVATE/PROTECTED/PUBLIC MEMBERS 24
/**//// <summary> 25
/// Public event used to indicate in settings have been changed. 26
/// </summary> 27
public static event EventHandler<EventArgs> Changed; 28
/**//// <summary> 29
/// Private member to hold singleton instance. 30
/// </summary> 31
private static BlogSettings blogSettingsSingleton; 32
/**//// <summary> 33
/// Private member to hold the title of the blog. 34
/// </summary> 35
private string blogName = String.Empty; 36
/**//// <summary> 37
/// Private member to hold a brief synopsis of the blog. 38
/// </summary> 39
private string blogDescription = String.Empty; 40
/**//// <summary> 41
/// Private member to hold the default number of posts per day to display. 42
/// </summary> 43
private int postsPerPage = Int32.MinValue; 44
/**//// <summary> 45
/// Private member to hold blog storage location. 46
/// </summary> 47
private string storageLocation = String.Empty; 48
/**//// <summary> 49
/// Private member to hold maximum number of characters that are displayed from a blog-roll retrieved post. 50
/// </summary> 51
private int blogrollMaxLength = Int32.MinValue; 52
/**//// <summary> 53
/// Private member to hold the number of minutes blog-roll entries are updated. 54
/// </summary> 55
private int blogrollUpdateMinutes = Int32.MinValue; 56
/**//// <summary> 57
/// Private member to hold the maximum number of blog-roll posts per blog-roll to display. 58
/// </summary> 59
private int blogrollVisiblePosts = Int32.MinValue; 60
/**//// <summary> 61
/// Private member to hold the name of the configured theme. 62
/// </summary> 63
private string configuredTheme = String.Empty; 64
/**//// <summary> 65
/// Private member to hold a value indicating if related posts is enabled. 66
/// </summary> 67
private bool enableRelatedPosts; 68
/**//// <summary> 69
/// Private member to hold the email address notifications are sent to. 70
/// </summary> 71
private string emailAddress = String.Empty; 72
/**//// <summary> 73
/// Private member to hold the SMTP server to contact when sending email. 74
/// </summary> 75
private string smtpServer = String.Empty; 76
/**//// <summary> 77
/// Private member to hold the SMTP port number. 78
/// </summary> 79
private int smtpServerPort = Int32.MinValue; 80
/**//// <summary> 81
/// Private member to hold the username used when contacting the SMTP server. 82
/// </summary> 83
private string smtpUsername = String.Empty; 84
/**//// <summary> 85
/// Private member to hold the password used when contacting the SMTP server. 86
/// </summary> 87
private string smtpPassword = String.Empty; 88
/**//// <summary> 89
/// Private member to hold a value indicating if mail is sent when a new comment is posted. 90
/// </summary> 91
private bool sendMailOnComment; 92
/**//// <summary> 93
/// Private member to hold a value indicating if post comments are enabled. 94
/// </summary> 95
private bool areCommentsEnabled; 96
/**//// <summary> 97
/// Private member to hold a value indicating if display of country of commenter is enabled. 98
/// </summary> 99
private bool enableCountryInComments; 100
/**//// <summary> 101
/// Private member to hold a value indicating live preview of posts is enabled. 102
/// </summary> 103
private bool showLivePreview; 104
/**//// <summary> 105
/// Private member to hold a value indicating if CoComment is enabled. 106
/// </summary> 107
private bool isCoCommentEnabled; 108
/**//// <summary> 109
/// Private member to hold number of days before post comments are closed. 110
/// </summary> 111
private int daysCommentsAreEnabled = Int32.MinValue; 112
/**//// <summary> 113
/// Private member to hold info on whether comments are moderated or not. 114
/// </summary> 115
private bool areCommentsModerated = false; 116
/**//// <summary> 117
/// Private member to hold default number of recent posts to display. 118
/// </summary> 119
private int numberOfRecentPosts = 10; 120
/**//// <summary> 121
/// Private member to hold the search button text. 122
/// </summary> 123
private string searchButtonText = String.Empty; 124
/**//// <summary> 125
/// Private member to hold the default search text. 126
/// </summary> 127
private string searchDefaultText = String.Empty; 128
/**//// <summary> 129
/// Private member to hold a value indicating 130
/// </summary> 131
private bool enableCommentSearch; 132
/**//// <summary> 133
/// Private member to hold the search comment label text. 134
/// </summary> 135
private string searchCommentLabelText = String.Empty; 136
/**//// <summary> 137
/// Private member to hold a value indicating if referral tracking is enabled. 138
/// </summary> 139
private bool enableReferrerTracking; 140
/**//// <summary> 141
/// Private member to hold a value indicating if HTTP compression is enabled. 142
/// </summary> 143
private bool enableHttpCompression; 144
/**//// <summary> 145
/// Private member to hold the URI of a web log that the author of this web log is promoting. 146
/// </summary> 147
private string blogChannelBLink = String.Empty; 148
/**//// <summary> 149
/// Private member to hold the name of the author of the blog. 150
/// </summary> 151
private string dublinCoreCreator = String.Empty; 152
/**//// <summary> 153
/// Private member to hold the language the blog is written in. 154
/// </summary> 155
private string dublinCoreLanguage = String.Empty; 156
/**//// <summary> 157
/// Private member to hold the latitude component of the geocoding position for this blog. 158
/// </summary> 159
private float geocodingLatitude = Single.MinValue; 160
/**//// <summary> 161
/// Private member to hold the longitude component of the geocoding position for this blog. 162
/// </summary> 163
private float geocodingLongitude = Single.MinValue; 164
/**//// <summary> 165
/// Private member to hold the default syndication format for this blog. 166
/// </summary> 167
private string defaultSyndicationFormat = String.Empty; 168
/**//// <summary> 169
/// Private member to hold a value indicating if the css files should be compressed. 170
/// </summary> 171
private bool removeWhitespaceInStyleSheets; 172
/**//// <summary> 173
/// Private member to hold a value indicating if the open search link header should be added. 174
/// </summary> 175
private bool enableOpenSearch; 176
/**//// <summary> 177
/// Private member to hold a tracking script from e.g. Google Analytics. 178
/// </summary> 179
private string trackingScript; 180
/**//// <summary> 181
/// Connection String for MSSQL Provider 182
/// </summary> 183
private string mssqlConnectionString; 184
/**//// <summary> 185
/// Feedburner user name. 186
/// </summary> 187
private string alternateFeedUrl; 188
189
private string contactFormMessage; 190
private string contactThankMessage; 191
private string htmlHeader; 192
private string culture; 193
private double timezone; 194
private int postsPerFeed; 195
private bool displayCommentsOnRecentPosts; 196
private bool displayRatingsOnRecentPosts; 197
private bool enableContactAttachments; 198
private bool enableSsl; 199
private bool enableRating; 200
private string handleWwwSubdomain; 201
private bool showDescriptionInPostList; 202
private string avatar; 203
private int numberOfRecentComments = 10; 204
#endregion 205
206
//============================================================ 207
// CONSTRUCTORS 208
//============================================================ 209
BlogSettings()#region BlogSettings() 210
/**//// <summary> 211
/// Initializes a new instance of the <see cref="BlogSettings"/> class. 212
/// </summary> 213
private BlogSettings() 214
...{ 215
//------------------------------------------------------------ 216
// Attempt to initialize class state 217
//------------------------------------------------------------ 218
//try 219
//{ 220
//------------------------------------------------------------ 221
// Load the currently configured settings 222
//------------------------------------------------------------ 223
Load(); 224
//} 225
//catch 226
//{ 227
// //------------------------------------------------------------ 228
// // Rethrow exception 229
// //------------------------------------------------------------ 230
// throw; 231
//} 232
} 233
#endregion 234
235
//============================================================ 236
// STATIC PROPERTIES 237
//============================================================ 238
Instance#region Instance 239
/**//// <summary> 240
/// Gets the singleton instance of the <see cref="BlogSettings"/> class. 241
/// </summary> 242
/// <value>A singleton instance of the <see cref="BlogSettings"/> class.</value> 243
/// <remarks></remarks> 244
public static BlogSettings Instance 245
...{ 246
get 247





