Example #1
0
        /// <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");
            }
        }
Example #2
0
        /// <inheritdoc />
        public ISnapshotDataProxy CopyInstance(ISnapshotDataProxy oldData)
        {
            LazyCopySnapshotDataProxy proxy = LazyCopySnapshotDataProxy.Convert(oldData);

            return(new LazyCopySnapshotDataProxy(proxy));
        }
Example #3
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;
 }