/// <summary> /// Converts the specified proxy to LazyCopySnapshotDataProxy type. /// </summary> /// <param name="proxy">The proxy.</param> /// <returns>Casted object to LazyCopySnapshotDataProxy type.</returns> /// <exception cref="System.InvalidCastException">Argument is not of type CopySnapshotDataProxy</exception> public static LazyCopySnapshotDataProxy Convert(ISnapshotDataProxy proxy) { LazyCopySnapshotDataProxy converted = proxy as LazyCopySnapshotDataProxy; if (converted != null) { return(converted); } else { throw new InvalidCastException("Argument is not of type CopySnapshotDataProxy"); } }
/// <inheritdoc /> public ISnapshotDataProxy CopyInstance(ISnapshotDataProxy oldData) { LazyCopySnapshotDataProxy proxy = LazyCopySnapshotDataProxy.Convert(oldData); return(new LazyCopySnapshotDataProxy(proxy)); }
/// <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; }