예제 #1
0
 private FileHeaderInfo FindLastUploadedFile()
 {
     for (int i = this.StateStore.Fields.Count - 1; i >= 0; i--)
     {
         RequestField field = this.StateStore.Fields[i];
         if (field.Header is FileHeaderInfo)
         {
             return((FileHeaderInfo)field.Header);
         }
     }
     return(null);
 }
예제 #2
0
        private int GetCompleteFileCount()
        {
            int num = 0;

            for (int i = 0; i < this.StateStore.Fields.Count; i++)
            {
                RequestField field = this.StateStore.Fields[i];
                if (this.isFileField(field))
                {
                    num++;
                }
            }
            return(num);
        }
예제 #3
0
        public void Record(byte[] fieldContent, bool isFinal)
        {
            if (this._currentField == null)
            {
                this._currentField = new RequestField(this._encoding);
            }
            bool flag = this._currentField.Header != null;

            this._currentField.AddData(fieldContent, isFinal);
            if (!flag && (this._currentField.Header != null))
            {
                this.Fields.Add(this._currentField);
            }
            if (isFinal)
            {
                this._currentField = null;
            }
        }
예제 #4
0
 private bool isFileField(RequestField field)
 {
     return(((field.Header is FileHeaderInfo) && field.Complete) && !string.IsNullOrEmpty(((FileHeaderInfo)field.Header).FileName));
 }
 public void Record(byte[] fieldContent, bool isFinal)
 {
     if (this._currentField == null)
     {
         this._currentField = new RequestField(this._encoding);
     }
     bool flag = this._currentField.Header != null;
     this._currentField.AddData(fieldContent, isFinal);
     if (!flag && (this._currentField.Header != null))
     {
         this.Fields.Add(this._currentField);
     }
     if (isFinal)
     {
         this._currentField = null;
     }
 }
 private bool isFileField(RequestField field)
 {
     return (((field.Header is FileHeaderInfo) && field.Complete) && !string.IsNullOrEmpty(((FileHeaderInfo)field.Header).FileName));
 }