/// <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 SnapshotDataAssociativeContainer Copy() { SnapshotDataAssociativeContainer data = new SnapshotDataAssociativeContainer(); data.IndexData = new Dictionary <MemoryIndex, MemoryEntry>(IndexData); return(data); }
/// <inheritdoc /> public ISnapshotDataProxy CreateNewInstanceWithData(IReadOnlySnapshotData oldData) { SnapshotDataAssociativeContainer data = oldData as SnapshotDataAssociativeContainer; if (data != null) { return(new CopySnapshotDataProxy(data)); } else { throw new InvalidCastException("Argument is not of type SnapshotDataAssociativeContainer"); } }
/// <summary> /// Initializes a new instance of the /// <see cref="CopySnapshotDataProxy" /> class. /// Deeply copies given proxy instance. /// </summary> /// <param name="proxy">The proxy.</param> public CopySnapshotDataProxy(CopySnapshotDataProxy proxy) { snapshotData = proxy.snapshotData.Copy(); }
/// <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 CopySnapshotDataProxy(SnapshotDataAssociativeContainer oldData) { snapshotData = oldData.Copy(); }
/// <summary> /// Initializes a new instance of the <see cref="CopySnapshotDataProxy" /> class. /// </summary> public CopySnapshotDataProxy() { snapshotData = new SnapshotDataAssociativeContainer(); }
/// <summary> /// Initializes a new instance of the /// <see cref="LazyCopySnapshotDataProxy" /> class. /// Deeply copies given proxy instance. /// </summary> /// <param name="proxy">The proxy.</param> public LazyCopySnapshotDataProxy(LazyCopySnapshotDataProxy proxy) { readonlyInstance = proxy.readonlyInstance; }
/// <summary> /// Initializes a new instance of the /// <see cref="LazyCopySnapshotDataProxy" /> class. /// Uses given data instance as readonly source of data. /// </summary> /// <param name="oldData">The old data.</param> public LazyCopySnapshotDataProxy(SnapshotDataAssociativeContainer oldData) { readonlyInstance = oldData; }
/// <summary> /// Initializes a new instance of the <see cref="LazyCopySnapshotDataProxy" /> class. /// </summary> public LazyCopySnapshotDataProxy() { snapshotData = new SnapshotDataAssociativeContainer(); readonlyInstance = snapshotData; isReadonly = false; }