Esempio n. 1
0
        /// <summary>
        /// Returns an <see cref="IUploadState"/> for a given post-back ID
        /// </summary>
        /// <param name="postBackID">
        /// A post-back ID identifying the <see cref="IUploadState"/>.
        /// </param>
        /// <returns>
        /// The <see cref="IUploadState"/> corresponding to
        /// <paramref name="postBackID"/>
        /// </returns>
        public static UploadState OpenReadOnly(string postBackID)
        {
            UploadState uploadState = Provider.Load(postBackID);

            if (uploadState == null)
            {
                return(null);
            }
            UploadState uploadStateCopy = new UploadState();

            uploadStateCopy.CopyFrom(uploadState);
            uploadStateCopy.IsWritable = false;
            return(uploadStateCopy);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns an <see cref="UploadState"/> for a given post-back ID.
        /// or null if none exists.
        /// </summary>
        /// <param name="postBackID">
        /// A post-back ID identifying the <see cref="UploadState"/>.
        /// </param>
        /// <returns>
        /// The <see cref="IUploadState"/> corresponding to
        /// <paramref name="postBackID"/>, or null if none-exists.
        /// </returns>
        public static UploadState OpenReadWrite(string postBackID)
        {
            UploadState uploadState = Provider.Load(postBackID);

            if (uploadState != null)
            {
                if (uploadState.DeleteAfterDelayWhenNotOpenReadWrite)
                {
                    CancelDeleteAfterDelay(uploadState.PostBackID);
                }
                UploadState uploadStateCopy = new UploadState();
                uploadStateCopy.CopyFrom(uploadState);
                uploadStateCopy.IsWritable = true;
                uploadStateCopy.DeleteAfterDelayWhenNotOpenReadWrite
                    = uploadState.DeleteAfterDelayWhenNotOpenReadWrite;
                uploadStateCopy.OnMerged();
                uploadStateCopy.Changed += new EventHandler(UploadState_Changed);
                uploadState              = uploadStateCopy;
            }
            return(uploadState);
        }
Esempio n. 3
0
 /// <summary>
 /// Returns an <see cref="IUploadState"/> for a given post-back ID  
 /// </summary>
 /// <param name="postBackID">
 /// A post-back ID identifying the <see cref="IUploadState"/>.
 /// </param>
 /// <returns>
 /// The <see cref="IUploadState"/> corresponding to 
 /// <paramref name="postBackID"/>
 /// </returns>
 public static UploadState OpenReadOnly(string postBackID)
 {
     UploadState uploadState = Provider.Load(postBackID);
     if (uploadState == null)
         return null;
     UploadState uploadStateCopy = new UploadState();
     uploadStateCopy.CopyFrom(uploadState);
     uploadStateCopy.IsWritable = false;
     return uploadStateCopy;
 }