Exemplo n.º 1
0
 public override void AddRange(UploadedFileCollection collection)
 {
     lock (this._root)
     {
         this._collection.AddRange(collection);
     }
 }
Exemplo n.º 2
0
 public static UploadedFileCollection Synchronized(UploadedFileCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     return(new SyncList(collection));
 }
Exemplo n.º 3
0
 public static UploadedFileCollection ReadOnly(UploadedFileCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     return(new ReadOnlyList(collection));
 }
Exemplo n.º 4
0
        public virtual object Clone()
        {
            UploadedFileCollection files = new UploadedFileCollection(this._count);

            Array.Copy(this._array, 0, files._array, 0, this._count);
            files._count   = this._count;
            files._version = this._version;
            return(files);
        }
        /// <summary>
        /// 获取上传文件集合
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public static UploadedFileCollection GetUploadedFiles(HttpContext context)
        {
            MimeUploadHandler handler = (MimeUploadHandler)context.Items["_uploadHandler"];

            if (handler != null)
            {
                return(UploadedFileCollection.ReadOnly(handler.UploadedFiles));
            }
            return(null);
        }
Exemplo n.º 6
0
 internal UploadedFileCollection(UploadedFileCollection collection)
 {
     this._array   = null;
     this._count   = 0;
     this._version = 0;
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     this._array = new UploadedFile[collection.Count];
     this.AddRange(collection);
 }
Exemplo n.º 7
0
 public virtual void AddRange(UploadedFileCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     if (collection.Count != 0)
     {
         if ((this._count + collection.Count) > this._array.Length)
         {
             this.EnsureCapacity(this._count + collection.Count);
         }
         this._version++;
         Array.Copy(collection._array, 0, this._array, this._count, collection.Count);
         this._count += collection.Count;
     }
 }
Exemplo n.º 8
0
        public void Parse()
        {
            this._uploadedFiles = new UploadedFileCollection();
            this._textParts     = new StringBuilder();
            MimePushReader reader = new MimePushReader(this._s, this._boundary, this, this.encoding);

            try
            {
                reader.Parse();
            }
            catch (DisconnectedException)
            {
                if (this.currentStream != null)
                {
                    this.currentStream.Close();
                }
                throw;
            }
        }
Exemplo n.º 9
0
 internal SyncList(UploadedFileCollection collection) : base(UploadedFileCollection.Tag.Default)
 {
     this._root       = collection.SyncRoot;
     this._collection = collection;
 }
Exemplo n.º 10
0
 public override void AddRange(UploadedFileCollection collection)
 {
     throw new NotSupportedException("Read-only collections cannot be modified.");
 }
Exemplo n.º 11
0
 internal ReadOnlyList(UploadedFileCollection collection) : base(UploadedFileCollection.Tag.Default)
 {
     this._collection = collection;
 }
Exemplo n.º 12
0
 internal IUploadedFileEnumerator(UploadedFileCollection collection)
 {
     this._collection = collection;
     this._version    = collection._version;
     this._index      = -1;
 }