예제 #1
0
 /// <inheritdoc/>
 public void Set(MemoryProperty property, DataObject value)
 {
     if (ContainsKey(property))
     {
         GetGroupFor(property).Set(property, value);
     }
     else
     {
         throw new MemoryException($"Attempted to set the value of property {property.Key} which does not exist in this LinkedMemoryGroup.");
     }
 }
예제 #2
0
 /// <inheritdoc/>
 public void Set(MemoryProperty property, DataObject value)
 {
     if (ContainsKey(property))
     {
         Items.First(i => i.Property == property).Set(value);
     }
     else
     {
         throw new MemoryException($"Attempted to set the value of property {property.Key} which does not exist in this MemoryGroup.");
     }
 }
예제 #3
0
 /// <inheritdoc/>
 public MemoryItem Get(MemoryProperty property)
 {
     return(GetGroupFor(property).Get(property));
 }
예제 #4
0
 /// <summary>
 /// Internal - gets the group in <see cref="LinkedGroups"/> that contains the specified key.
 /// </summary>
 /// <param name="property">The <see cref="MemoryProperty"/> identifying the memory item.</param>
 private IMemoryGroup GetGroupFor(MemoryProperty property)
 {
     return(LinkedGroups.First(g => g.ContainsKey(property)));
 }
예제 #5
0
 /// <inheritdoc/>
 public bool ContainsKey(MemoryProperty property)
 {
     return(LinkedGroups.SelectMany(g => g.GetKeys()).Contains(property));
 }
예제 #6
0
 /// <summary>
 /// Internal - gets the group in <see cref="Layers"/> that contains the specified key.
 /// </summary>
 /// <param name="property">The <see cref="MemoryProperty"/> identifying the memory item.</param>
 private IMemoryGroup GetGroupFor(MemoryProperty property)
 {
     return(Layers.First(l => l.ContainsKey(property)));
 }
예제 #7
0
 /// <inheritdoc/>
 public bool ContainsKey(MemoryProperty property)
 {
     return(GetKeys().Contains(property));
 }
예제 #8
0
 /// <inheritdoc/>
 public MemoryItem Get(MemoryProperty property)
 {
     return(Items.First(i => i.Property == property));
 }
예제 #9
0
 /// <inheritdoc/>
 public bool ContainsKey(MemoryProperty property)
 {
     return(Items.Any(i => i.Property == property));
 }
예제 #10
0
 /// <summary>
 /// Creates a new memory item with given property information.
 /// </summary>
 /// <param name="property">Specifies information regarding the key and type of the <see cref="MemoryItem"/>, as well as setting various <see cref="PropertyFlags"/>.</param>
 public MemoryItem(MemoryProperty property)
 {
     Property = property;
 }