예제 #1
0
        /// <summary>
        /// Converts the specified proxy to CopySnapshotDataProxy type.
        /// </summary>
        /// <param name="proxy">The proxy.</param>
        /// <returns>Casted object to CopySnapshotDataProxy type.</returns>
        /// <exception cref="System.InvalidCastException">Argument is not of type CopySnapshotDataProxy</exception>
        public static TrackingSnapshotDataProxy Convert(ISnapshotDataProxy proxy)
        {
            TrackingSnapshotDataProxy converted = proxy as TrackingSnapshotDataProxy;

            if (converted != null)
            {
                return(converted);
            }
            else
            {
                throw new InvalidCastException("Argument is not of type CopySnapshotDataProxy");
            }
        }
예제 #2
0
        /// <inheritdoc />
        public ISnapshotDataProxy CopyInstance(ISnapshotDataProxy oldData)
        {
            TrackingSnapshotDataProxy proxy = TrackingSnapshotDataProxy.Convert(oldData);

            return(new TrackingSnapshotDataProxy(proxy));
        }
예제 #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;
 }