public override void AddRange(UploadedFileCollection collection) { lock (this._root) { this._collection.AddRange(collection); } }
public static UploadedFileCollection Synchronized(UploadedFileCollection collection) { if (collection == null) { throw new ArgumentNullException("collection"); } return(new SyncList(collection)); }
public static UploadedFileCollection ReadOnly(UploadedFileCollection collection) { if (collection == null) { throw new ArgumentNullException("collection"); } return(new ReadOnlyList(collection)); }
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); }
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); }
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; } }
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; } }
internal SyncList(UploadedFileCollection collection) : base(UploadedFileCollection.Tag.Default) { this._root = collection.SyncRoot; this._collection = collection; }
public override void AddRange(UploadedFileCollection collection) { throw new NotSupportedException("Read-only collections cannot be modified."); }
internal ReadOnlyList(UploadedFileCollection collection) : base(UploadedFileCollection.Tag.Default) { this._collection = collection; }
internal IUploadedFileEnumerator(UploadedFileCollection collection) { this._collection = collection; this._version = collection._version; this._index = -1; }