Avoid doubly declaring some types in the 2.1 profile for mobile
[mono.git] / mcs / class / System.ServiceModel / Dummy_2_1.cs
1 using System.Collections.Generic;
2 using System.Reflection;
3 using System.Runtime.Serialization;
4 using System.Runtime.CompilerServices;
5 using System.ServiceModel.Channels;
6 using System.ServiceModel.Dispatcher;
7 using System.Text;
8 using System.Xml;
9
10 #if !MOBILE
11 namespace System.Runtime.CompilerServices
12 {
13         // introduced for silverlight sdk compatibility
14         internal class FriendAccessAllowedAttribute : Attribute
15         {
16                 public FriendAccessAllowedAttribute ()
17                 {
18                 }
19         }
20 }
21 #endif
22
23 namespace System.ServiceModel
24 {
25         public class EndpointIdentity {}
26         public class InstanceContext
27         {
28                 public InstanceContext (object dummy) {}
29         }
30         // introduced for silverlight sdk compatibility
31         internal class OperationFormatStyleHelper
32         {
33                 public static bool IsDefined (OperationFormatStyle style)
34                 {
35                         switch (style) {
36                         case OperationFormatStyle.Document:
37                         case OperationFormatStyle.Rpc:
38                                 return true;
39                         }
40                         return false;
41                 }
42         }
43         
44         [FriendAccessAllowed]
45         internal interface IDispatchOperation
46         {
47                 bool DeserializeRequest { get; set; }
48                 IDispatchMessageFormatter Formatter { get; set; }
49                 string Name { get; }
50                 bool SerializeReply { get; set; }
51         }
52 }
53 namespace System.ServiceModel.Channels
54 {
55         public interface ITransportTokenAssertionProvider {}
56         public static class UrlUtility {
57                 public static string UrlEncode (string s, Encoding e)
58                 {
59                         return s;
60                 }
61
62                 public static string UrlDecode (string s, Encoding e)
63                 {
64                         return s;
65                 }
66         }
67 }
68 namespace System.ServiceModel.Channels.Http
69 {
70 }
71 namespace System.ServiceModel.Channels.Security
72 {
73 }
74 namespace System.ServiceModel.Configuration
75 {
76         class Dummy {}
77 }
78 namespace System.ServiceModel.Description
79 {
80         public interface IPolicyExportExtension {}
81         public interface IPolicyImportExtension {}
82         public interface IWsdlExportExtension {}
83         public interface IWsdlImportExtension {}
84
85         // introduced for silverlight sdk compatibility
86         internal class ServiceReflector
87         {
88                 public static T GetSingleAttribute<T> (ICustomAttributeProvider p, Type [] types)
89                 {
90                         T ret = default (T);
91                         foreach (Type t in types) {
92                                 foreach (object att in p.GetCustomAttributes (t, false)) {
93                                         if (att is T) {
94                                                 if (ret != null)
95                                                         throw new InvalidOperationException (String.Format ("More than one {0} attributes are found in the argument types", typeof (T)));
96                                                 ret = (T) att;
97                                         }
98                                 }
99                         }
100                         return ret;
101                 }
102         }
103 }
104 namespace System.ServiceModel
105 {
106         // introduced for silverlight sdk compatibility
107         internal interface IDuplexHelper { }
108
109         [FriendAccessAllowed ()]
110         internal class DiagnosticUtility
111         {
112                 [FriendAccessAllowed ()]
113                 internal class ExceptionUtility
114                 {
115                         public static Exception ThrowHelperArgument (string message) { throw new NotImplementedException (); }
116                         
117                         public static Exception ThrowHelperArgument (string paramName, string message) { throw new NotImplementedException (); }
118                         
119                         public static Exception ThrowHelperArgumentNull (string arg)
120                         {
121                                 return new ArgumentNullException (arg);
122                         }
123
124                         [FriendAccessAllowed]
125                         internal static Exception ThrowHelperCallback (Exception e) { throw new NotImplementedException (); }
126                         
127                         [FriendAccessAllowed]
128                         internal static Exception ThrowHelperCallback (string message, Exception innerException) { throw new NotImplementedException (); }
129                         
130                         public static Exception ThrowHelperError (Exception error)
131                         {
132                                 return error;
133                         }
134                         
135                         [FriendAccessAllowed]
136                         internal static Exception ThrowHelperFatal (string message, Exception innerException) { throw new NotImplementedException (); }
137                         
138                         [FriendAccessAllowed]
139                         internal static Exception ThrowHelperInternal (bool fatal) { throw new NotImplementedException (); }
140                         
141                         public static Exception ThrowHelperWarning (Exception e) { throw new NotImplementedException (); }
142                 }
143         }
144 }
145
146 namespace System.ServiceModel.Dispatcher
147 {
148         public sealed class EndpointDispatcher
149         {
150                 internal EndpointDispatcher ()
151                 {
152                 }
153         }
154
155         internal class FaultFormatter : IClientFaultFormatter
156         {
157                 internal FaultFormatter (Type[] detailTypes) { throw new NotImplementedException (); }
158                 internal FaultFormatter (SynchronizedCollection<FaultContractInfo> faultContractInfoCollection) { throw new NotImplementedException (); }
159                 protected virtual FaultException CreateFaultException (MessageFault messageFault, string action) { throw new NotImplementedException (); }
160                 protected FaultException CreateFaultException (MessageFault messageFault, string action, object detailObj, Type detailType, XmlDictionaryReader detailReader) { throw new NotImplementedException (); }
161                 public FaultException Deserialize (MessageFault messageFault, string action) { throw new NotImplementedException (); }
162                 protected virtual XmlObjectSerializer GetSerializer (Type detailType, string faultExceptionAction, out string action) { throw new NotImplementedException (); }
163         }
164
165         internal interface IClientFaultFormatter
166         {
167                 FaultException Deserialize (MessageFault messageFault, string action);
168         }
169 }
170 namespace System.ServiceModel.Security
171 {
172         class Dummy {}
173 }
174 #if !MOBILE
175 namespace System.Net.Security
176 {
177         public enum ProtectionLevel {None}
178 }
179 namespace System.Xml.Serialization
180 {
181         public class XmlTypeMapping {}
182 }
183 namespace System.Xml.XPath
184 {
185         class Dummy {}
186 }
187 namespace Mono.Xml.XPath
188 {
189         class Dummy {}
190 }
191 #endif