Beispiel #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 CopySnapshotDataProxy Convert(ISnapshotDataProxy proxy)
        {
            CopySnapshotDataProxy converted = proxy as CopySnapshotDataProxy;

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

            return(new CopySnapshotDataProxy(proxy));
        }
Beispiel #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();
 }