[System*] Throw a PlatformNotSupported exception when using the managed networking...
[mono.git] / mcs / class / System / System.Net / AuthenticationManager.platformnotsupported.cs
1 //
2 // AuthenticationManager.cs
3 //
4 // Author:
5 //       Rolf Bjarne Kvinge <rolf@xamarin.com>
6 //
7 // Copyright (c) 2016 Xamarin, Inc.
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 // THE SOFTWARE.
26
27 using System.Collections;
28 using System.Collections.Specialized;
29
30 namespace System.Net
31 {
32         public class AuthenticationManager {
33                 const string EXCEPTION_MESSAGE = "System.Net.AuthenticationManager is not supported on the current platform.";
34
35                 private AuthenticationManager ()
36                 {
37                 }
38
39                 public static ICredentialPolicy CredentialPolicy {
40                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
41                         set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
42                 }
43
44                 public static StringDictionary CustomTargetNameDictionary {
45                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
46                 }
47
48                 public static IEnumerator RegisteredModules {
49                         get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
50                 }
51
52                 public static Authorization Authenticate (string challenge, WebRequest request, ICredentials credentials)
53                 {
54                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
55                 }
56
57                 public static Authorization PreAuthenticate (WebRequest request, ICredentials credentials)
58                 {
59                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
60                 }
61
62                 public static void Register (IAuthenticationModule authenticationModule)
63                 {
64                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
65                 }
66
67                 public static void Unregister (IAuthenticationModule authenticationModule)
68                 {
69                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
70                 }
71
72                 public static void Unregister (string authenticationScheme)
73                 {
74                         throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
75                 }
76         }
77 }