diff --git a/zaaReloaded2/Controller/Settings.cs b/zaaReloaded2/Controller/Settings.cs index ba595ed..46b1593 100755 --- a/zaaReloaded2/Controller/Settings.cs +++ b/zaaReloaded2/Controller/Settings.cs @@ -47,6 +47,12 @@ namespace zaaReloaded2.Controller /// public IList Elements { get; private set; } + /// + /// Gets the unique ID of this Settings object. The unique + /// ID is not included in deep-copying (cloning). + /// + public Guid Uid { get; private set; } + #endregion #region Constructors @@ -54,6 +60,7 @@ namespace zaaReloaded2.Controller public Settings() { Elements = new List(); + Uid = Guid.NewGuid(); } public Settings(string name) diff --git a/zaaReloaded2/Controller/SettingsRepository.cs b/zaaReloaded2/Controller/SettingsRepository.cs index 0cf5cd4..a8e55cb 100755 --- a/zaaReloaded2/Controller/SettingsRepository.cs +++ b/zaaReloaded2/Controller/SettingsRepository.cs @@ -76,6 +76,21 @@ namespace zaaReloaded2.Controller #endregion + #region Public methods + + /// + /// Looks up a Settings object contained in this repository + /// by unique ID. + /// + /// GUID to look for. + /// Settings object with this GUID, or null if the + /// GUID was not found. + public Settings FindByGuid(Guid uid) + { + return SettingsList.FirstOrDefault(s => s.Uid == uid); + } + #endregion + #region Private methods ///