Comment on serialization.

This commit is contained in:
Daniel Kraus
2015-08-11 19:51:23 +02:00
parent 6af2243660
commit 00c60ba0ad
2 changed files with 49 additions and 0 deletions

View File

@ -44,6 +44,19 @@ namespace zaaReloaded2.Controller
{
#region Properties persistence
/// <summary>
/// Loads the SettingsRepository instance that was persisted in
/// the assembly properties.
/// </summary>
/// <returns>SettingsRepository that was last stored in the
/// assembly properties, or a newly created SettingsRepository
/// if no previously stored exists.</returns>
/// <remarks>
/// The SettingsRepository is serialized using a SoapFormatter, which
/// creates SOAP XML. Since the assembly properties are stored as
/// XML as well, the serialized SettingsRepository is converted to
/// a base-64 string, which does not mess with the properties XML.
/// </remarks>
public static SettingsRepository Load()
{
string s = Properties.Settings.Default.SettingsRepository;
@ -63,6 +76,15 @@ namespace zaaReloaded2.Controller
}
}
/// <summary>
/// Stores the SettingsRepository in the assembly properties.
/// </summary>
/// <remarks>
/// The SettingsRepository is serialized using a SoapFormatter, which
/// creates SOAP XML. Since the assembly properties are stored as
/// XML as well, the serialized SettingsRepository is converted to
/// a base-64 string, which does not mess with the properties XML.
/// </remarks>
public void Store()
{
MemoryStream stream = new MemoryStream();