Esempio n. 1
0
 /// <summary>
 /// Gets the path of the object file for a given entity key.
 /// </summary>
 /// <param name="key">Key</param>
 /// <returns>The path where the object with this key should be stored.</returns>
 private string GetFilePath( EntityKey key )
 {
     return Path.Combine( directory, string.Format( objectFileMask, key ) );
 }
Esempio n. 2
0
 /// <summary>
 /// Gets an entity from the <see cref="Storage"/>.
 /// </summary>
 /// <param name="key">BaseEntity key.</param>
 /// <returns>The entity, or <b>null</b> if it was not found.</returns>
 internal BaseEntity GetEntity( EntityKey key )
 {
     return this.InternalGet( key );
 }
Esempio n. 3
0
 /// <summary>
 /// Makes a new (and unique) <see cref="Framework.EntityKey"/>.
 /// </summary>
 /// <returns>A new <see cref="Framework.EntityKey"/>.</returns>
 internal static EntityKey MakeEntityKey()
 {
     EntityKey entityKey = new EntityKey( Guid.NewGuid().ToString() );
     return entityKey;
 }
Esempio n. 4
0
 /// <summary>
 /// Gets an entity from the <see cref="Storage"/>.
 /// </summary>
 /// <param name="key">BaseEntity key.</param>
 /// <returns>The entity, or <b>null</b> if it was not found.</returns>
 internal BaseEntity GetEntity(EntityKey key)
 {
     return(this.InternalGet(key));
 }
Esempio n. 5
0
 /// <summary>
 /// Gets the path of the object file for a given entity key.
 /// </summary>
 /// <param name="key">Key</param>
 /// <returns>The path where the object with this key should be stored.</returns>
 private string GetFilePath(EntityKey key)
 {
     return(Path.Combine(directory, string.Format(objectFileMask, key)));
 }
Esempio n. 6
0
        /// <summary>
        /// Makes a new (and unique) <see cref="Framework.EntityKey"/>.
        /// </summary>
        /// <returns>A new <see cref="Framework.EntityKey"/>.</returns>
        internal static EntityKey MakeEntityKey()
        {
            EntityKey entityKey = new EntityKey(Guid.NewGuid().ToString());

            return(entityKey);
        }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new <see cref="EntityRef"/> from an <see cref="EntityKey"/>.
 /// </summary>
 /// <param name="entityKey">An <see cref="EntityKey"/> (eventually null).</param>
 public EntityRef(EntityKey entityKey)
 {
     this.entityKey = entityKey;
     this.target    = null;
 }