コード例 #1
0
        public void Save(IPersistable entry)
        {
            DataSettings dataSettings = entry.GetDataSettings();

            if (dataSettings.PersistanceType == PersistanceType.WriteOnly || dataSettings.PersistanceType == PersistanceType.ReadWrite)
            {
                string uniqueID = dataSettings.UniqueID;

                if (!string.IsNullOrEmpty(uniqueID))
                {
                    _data[uniqueID] = entry.Save();
                }
            }
        }
コード例 #2
0
        public void Load(IPersistable entry)
        {
            DataSettings settings = entry.GetDataSettings();

            if (settings.PersistanceType == PersistanceType.ReadOnly || settings.PersistanceType == PersistanceType.ReadWrite)
            {
                string uniqueID = settings.UniqueID;

                if (!string.IsNullOrEmpty(uniqueID) && _data.ContainsKey(uniqueID))
                {
                    entry.Load(_data[uniqueID]);
                }
            }
        }