代码中加这个是什么意思?
别人的码中加了如下内容是什么意思:为什么要加这个,Serializable有什么用?
[Serializable]
public class TemplateConfiguration
{
#region members
/// <summary>
/// The base folder of the templates, if any.
/// </summary>
private string baseDirectory;
/// <summary>
/// The SMTP server to be used.
/// </summary>
private string smtpServer;
/// <summary>
/// The available template groups.
/// </summary>
private ArrayList templateGroups;
#endregion
#region properties
/// <summary>
/// The base folder of the templates, if any.
/// </summary>
[XmlElement()]
public string BaseDirectory
{
get
{
return System.Configuration.ConfigurationSettings.AppSettings["MailTemplateBaseDirectory"];//不是前面已经有了这句了吗?怎么这里还要呢?
}
set
{
this.baseDirectory = value;
}
}
/// <summary>
/// The SMTP server to be used.
/// </summary>
[XmlElement()]
public string SmtpServer
{
get
{
return this.smtpServer;
}
set
{
this.smtpServer = value;
}
}
/// <summary>
/// The available template groups.
/// </summary>
[XmlArray("Groups")]
[XmlArrayItem("TemplateGroup", typeof(TemplateGroupElement))]
public ArrayList TemplateGroups
{
get
{
return this.templateGroups;
}
set
{
this.templateGroups = value;
}
}