Пример #1
0
 /// <summary>
 /// Creates empty structure which contains no data in containers.
 /// </summary>
 /// <param name="factories">The factories.</param>
 /// <returns>
 /// New empty structure which contains no data in containers.
 /// </returns>
 public static LazyCopySnapshotStructureProxy CreateEmpty(ModularMemoryModelFactories factories)
 {
     LazyCopySnapshotStructureProxy proxy = new LazyCopySnapshotStructureProxy(factories);
     proxy.snapshotStructure = SnapshotStructureContainer.CreateEmpty(factories);
     proxy.readonlyInstance = proxy.snapshotStructure;
     proxy.isReadonly = false;
     return proxy;
 }
Пример #2
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateNewInstanceWithData(IReadOnlySnapshotStructure oldData)
 {
     SnapshotStructureContainer data = oldData as SnapshotStructureContainer;
     if (data != null)
     {
         return LazyCopySnapshotStructureProxy.CreateWithData(data);
     }
     else
     {
         throw new InvalidCastException("Argument is not of type SnapshotStructureContainer");
     }
 }
Пример #3
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CopyInstance(ISnapshotStructureProxy oldData)
 {
     LazyCopySnapshotStructureProxy proxy = oldData as LazyCopySnapshotStructureProxy;
     if (proxy != null)
     {
         return proxy.Copy();
     }
     else
     {
         throw new InvalidCastException("Argument is not of type CopySnapshotStructureProxy");
     }
 }
Пример #4
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateGlobalContextInstance(ModularMemoryModelFactories factories)
 {
     return LazyCopySnapshotStructureProxy.CreateGlobal(factories);
 }
Пример #5
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateEmptyInstance(ModularMemoryModelFactories factories)
 {
     return LazyCopySnapshotStructureProxy.CreateEmpty(factories);
 }
Пример #6
0
 /// <summary>
 /// Creates new structure object with copy of diven data object.
 /// </summary>
 /// <param name="data">The old data.</param>
 /// <returns>
 /// New structure object with copy of diven data object.
 /// </returns>
 public static ISnapshotStructureProxy CreateWithData(SnapshotStructureContainer data)
 {
     LazyCopySnapshotStructureProxy proxy = new LazyCopySnapshotStructureProxy(data.Factories);
     proxy.readonlyInstance = data;
     return proxy;
 }
Пример #7
0
 /// <summary>
 /// Creates new structure object as copy of this structure which contains the same data as this instace.
 /// </summary>
 /// <returns>
 /// New copy of this structure which contains the same data as this instace.
 /// </returns>
 public LazyCopySnapshotStructureProxy Copy()
 {
     LazyCopySnapshotStructureProxy proxy = new LazyCopySnapshotStructureProxy(factories);
     proxy.readonlyInstance = this.readonlyInstance;
     return proxy;
 }