public override XElement ToXml()
{
var result = base.ToXml();
var connectionString = string.Join(";",
string.Format("Host={0}", Host),
string.Format("UserName={0}", UserName),
string.Format("Password={0}", Password),
string.Format("Port={0}", Port),
string.Format("EnableSsl={0}", EnableSsl),
string.Format("Timeout={0}", Timeout)
);
result.Add(
new XAttribute("ConnectionString", DpapiWrapper.Encrypt(connectionString)),
new XAttribute("Type", ResourceType),
new XElement("TypeOf", ResourceType)
);
return result;
}