Implement more of System.Net.Http
authorMarek Safar <marek.safar@gmail.com>
Thu, 29 Mar 2012 15:15:58 +0000 (16:15 +0100)
committerMarek Safar <marek.safar@gmail.com>
Thu, 29 Mar 2012 15:17:33 +0000 (16:17 +0100)
mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs [new file with mode: 0644]
mcs/class/System.Net.Http/System.Net.Http.dll.sources
mcs/class/System.Net.Http/System.Net.Http/DelegatingHandler.cs [new file with mode: 0644]

diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs
new file mode 100644 (file)
index 0000000..47f2938
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// ContentDispositionHeaderValue.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Generic;
+using System.Text;
+using System.Globalization;
+
+namespace System.Net.Http.Headers
+{
+       public class ContentDispositionHeaderValue : ICloneable
+       {
+               private ContentDispositionHeaderValue ()
+               {
+               }
+               
+               public string DispositionType { get; set; }
+               public string FileName { get; set; }
+               public string Name { get; set; }
+
+               object ICloneable.Clone ()
+               {
+                       return MemberwiseClone ();
+               }
+       }
+}
index bbbde1db749a9e9ce00cad4ba654cece1239bc84..daee130501b38b3f08d1ce2c1b3ed8a49de8de4e 100644 (file)
@@ -2,6 +2,7 @@
 Assembly/AssemblyInfo.cs
 System.Net.Http/ByteArrayContent.cs
 System.Net.Http/ClientCertificateOption.cs
+System.Net.Http/DelegatingHandler.cs
 System.Net.Http/HttpClient.cs
 System.Net.Http/HttpClientHandler.cs
 System.Net.Http/HttpCompletionOption.cs
diff --git a/mcs/class/System.Net.Http/System.Net.Http/DelegatingHandler.cs b/mcs/class/System.Net.Http/System.Net.Http/DelegatingHandler.cs
new file mode 100644 (file)
index 0000000..5bc1aa8
--- /dev/null
@@ -0,0 +1,67 @@
+//
+// DelegatingHandler.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2011 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Net.Http
+{
+       public abstract class DelegatingHandler : HttpMessageHandler
+       {
+               bool disposed;
+               
+               protected DelegatingHandler ()
+               {
+               }
+               
+               protected DelegatingHandler(HttpMessageHandler innerHandler)
+               {
+                       if (innerHandler == null)
+                               throw new ArgumentNullException ("innerHandler");
+                       
+                       InnerHandler = innerHandler;
+               }
+               
+               public HttpMessageHandler InnerHandler { get; set; }
+               
+               protected override void Dispose (bool disposing)
+               {
+                       if (disposing && !disposed) {
+                               disposed = true;
+                               InnerHandler.Dispose ();
+                       }
+                       
+                       base.Dispose (disposing);
+               }
+
+               protected internal override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}