Example #1
0
        /// <summary>
        /// Creates new data instance and copies data from this collection to the new one.
        /// </summary>
        /// <returns>
        /// New data instance and copies data from this collection to the new one.
        /// </returns>
        public TrackingSnapshotDataAssociativeContainer Copy()
        {
            TrackingSnapshotDataAssociativeContainer data = new TrackingSnapshotDataAssociativeContainer();

            data.IndexData = IndexData.Copy();
            data.tracker   = new ChangeTracker <IReadOnlySnapshotData>(data.DataId, data, this.tracker);

            return(data);
        }
Example #2
0
        /// <inheritdoc />
        public ISnapshotDataProxy CreateNewInstanceWithData(IReadOnlySnapshotData oldData)
        {
            TrackingSnapshotDataAssociativeContainer data = oldData as TrackingSnapshotDataAssociativeContainer;

            if (data != null)
            {
                return(new TrackingSnapshotDataProxy(data));
            }
            else
            {
                throw new InvalidCastException("Argument is not of type TrackingSnapshotDataAssociativeContainer");
            }
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="CopySnapshotDataProxy" /> class.
 /// Deeply copies given proxy instance.
 /// </summary>
 /// <param name="proxy">The proxy.</param>
 public TrackingSnapshotDataProxy(TrackingSnapshotDataProxy proxy)
 {
     readonlyInstance = proxy.readonlyInstance;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="CopySnapshotDataProxy" /> class.
 /// Uses given data instance as readonly source of data.
 /// </summary>
 /// <param name="oldData">The old data.</param>
 public TrackingSnapshotDataProxy(TrackingSnapshotDataAssociativeContainer oldData)
 {
     readonlyInstance = oldData;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CopySnapshotDataProxy" /> class.
 /// </summary>
 /// <param name="factories">The factories.</param>
 public TrackingSnapshotDataProxy(ModularMemoryModelFactories factories)
 {
     snapshotData     = new TrackingSnapshotDataAssociativeContainer(factories);
     isReadonly       = false;
     readonlyInstance = snapshotData;
 }