Changeset 1619


Ignore:
Timestamp:
01/19/10 09:20:54 (5 years ago)
Author:
lowjoel
Message:

FormField? => PostDataField? and FormFileField? => PostDataFileField?

Location:
branches/eraser6/CodeReview/Eraser.Util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser.Util/BlackBox.cs

    r1618 r1619  
    550550        { 
    551551            PostDataBuilder builder = new PostDataBuilder(); 
    552             builder.AddPart(new FormField("action", "status")); 
     552            builder.AddPart(new PostDataField("action", "status")); 
    553553            AddStackTraceToRequest(Report.StackTrace, builder); 
    554554 
     
    654654                //Build the POST request 
    655655                PostDataBuilder builder = new PostDataBuilder(); 
    656                 builder.AddPart(new FormField("action", "upload")); 
    657                 builder.AddPart(new FormFileField("crashReport", "Report.tbz", bzipFile)); 
     656                builder.AddPart(new PostDataField("action", "upload")); 
     657                builder.AddPart(new PostDataFileField("crashReport", "Report.tbz", bzipFile)); 
    658658                AddStackTraceToRequest(Report.StackTrace, builder); 
    659659 
     
    720720            { 
    721721                foreach (string stackFrame in exceptionStack.StackTrace) 
    722                     builder.AddPart(new FormField( 
     722                    builder.AddPart(new PostDataField( 
    723723                        string.Format("stackTrace[{0}][]", exceptionIndex), stackFrame)); 
    724                 builder.AddPart(new FormField(string.Format( 
     724                builder.AddPart(new PostDataField(string.Format( 
    725725                    "stackTrace[{0}][exception]", exceptionIndex), exceptionStack.ExceptionType)); 
    726726                ++exceptionIndex; 
  • branches/eraser6/CodeReview/Eraser.Util/PostDataBuilder.cs

    r1618 r1619  
    4040        } 
    4141 
    42         public void AddPart(FormField field) 
     42        public void AddPart(PostDataField field) 
    4343        { 
    4444            //Generate a random part boundary 
     
    5858                StringBuilder currentBoundary = new StringBuilder(); 
    5959                currentBoundary.AppendFormat("--{0}\r\n", Boundary); 
    60                 if (field is FormFileField) 
     60                if (field is PostDataFileField) 
    6161                { 
    6262                    currentBoundary.AppendFormat( 
    6363                        "Content-Disposition: file; name=\"{0}\"; filename=\"{1}\"\r\n", 
    64                         field.FieldName, ((FormFileField)field).FileName); 
     64                        field.FieldName, ((PostDataFileField)field).FileName); 
    6565                    currentBoundary.AppendLine("Content-Type: application/octet-stream"); 
    6666                } 
     
    147147    } 
    148148 
    149     class FormField 
     149    public class PostDataField 
    150150    { 
    151151        /// <summary> 
     
    154154        /// <param name="fieldName">The name of the field.</param> 
    155155        /// <param name="stream">The stream containing the field data.</param> 
    156         public FormField(string fieldName, Stream stream) 
     156        public PostDataField(string fieldName, Stream stream) 
    157157        { 
    158158            FieldName = fieldName; 
     
    165165        /// <param name="fieldName">The name of the field.</param> 
    166166        /// <param name="stream">The content of the field.</param> 
    167         public FormField(string fieldName, string content) 
     167        public PostDataField(string fieldName, string content) 
    168168            : this(fieldName, new MemoryStream(Encoding.UTF8.GetBytes(content))) 
    169169        { 
     
    181181    } 
    182182 
    183     class FormFileField : FormField 
     183    public class PostDataFileField : PostDataField 
    184184    { 
    185185        /// <summary> 
     
    189189        /// <param name="fileName">The name of the file.</param> 
    190190        /// <param name="stream">The stream containing the field data.</param> 
    191         public FormFileField(string fieldName, string fileName, Stream stream) 
     191        public PostDataFileField(string fieldName, string fileName, Stream stream) 
    192192            : base(fieldName, stream) 
    193193        { 
Note: See TracChangeset for help on using the changeset viewer.