Exemplo n.º 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 SnapshotDataAssociativeContainer Copy()
        {
            SnapshotDataAssociativeContainer data = new SnapshotDataAssociativeContainer();

            data.IndexData = new Dictionary <MemoryIndex, MemoryEntry>(IndexData);

            return(data);
        }
Exemplo n.º 2
0
        /// <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");
            }
        }
Exemplo n.º 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 CopySnapshotDataProxy(CopySnapshotDataProxy proxy)
 {
     snapshotData = proxy.snapshotData.Copy();
 }
Exemplo n.º 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 CopySnapshotDataProxy(SnapshotDataAssociativeContainer oldData)
 {
     snapshotData = oldData.Copy();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CopySnapshotDataProxy" /> class.
 /// </summary>
 public CopySnapshotDataProxy()
 {
     snapshotData = new SnapshotDataAssociativeContainer();
 }
Exemplo n.º 6
0
 /// <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;
 }
Exemplo n.º 7
0
 /// <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;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LazyCopySnapshotDataProxy" /> class.
 /// </summary>
 public LazyCopySnapshotDataProxy()
 {
     snapshotData     = new SnapshotDataAssociativeContainer();
     readonlyInstance = snapshotData;
     isReadonly       = false;
 }