NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
internal const string System = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string EcmaPublicKey = "b77a5c561934e089";
-#if NET_2_1
+#if MOBILE
public const string FrameworkPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
public const string FrameworkPublicKeyFull2 = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
#else
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";
-#if NET_2_1
+#if MOBILE
// Versions of .NET Framework for Silverlight 4.0
public const string FxVersion = "2.0.5.0";
public const string VsVersion = "9.0.0.0"; // unused, but needed for compilation
public const string AssemblyPresentationCore_4_0 = "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string AssemblyPresentationFramework_3_5 = "PresentationFramework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
public const string AssemblySystemServiceModel_3_0 = "System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
-#elif NET_2_1
+#elif MOBILE
public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089";
#endif
}
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
-#if NET_2_1
+#if MOBILE
[assembly: InternalsVisibleTo ("System, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
#else
[assembly: InternalsVisibleTo ("System, PublicKey=00000000000000000400000000000000")]
{
if (!isInitialized)
{
-#if !NET_2_1
+#if !MOBILE
Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
// Debug.Listeners.Add(new TextWriterTraceListener(@"c:\ssl.log"));
Debug.AutoFlush = true;
ClearCertificates (); // We have modified the store on disk. So forget the old state.
}
}
-#if !NET_2_1
+#if !MOBILE
// Try to save privateKey if available..
CspParameters cspParams = new CspParameters ();
cspParams.KeyContainerName = CryptoConvert.ToHex (certificate.Hash);
{
byte[] data = Load (filename);
X509Certificate cert = new X509Certificate (data);
-#if !NET_2_1
+#if !MOBILE
// If privateKey it's available, load it too..
CspParameters cspParams = new CspParameters ();
cspParams.KeyContainerName = CryptoConvert.ToHex (cert.Hash);
}
return list;
}
-#if !NET_2_1
+#if !MOBILE
private void ImportPrivateKey (X509Certificate certificate, CspParameters cspParams)
{
RSACryptoServiceProvider rsaCsp = certificate.RSA as RSACryptoServiceProvider;
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../winfx.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
// attributes specific to FX 3.5
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
exKey [i] = exKey [i-Nk] ^ temp;
}
-#if NET_2_1
+#if MOBILE
// Silverlight 2.0 only supports CBC
if (!encryption) {
#else
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace System.Security.Cryptography {
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !NET_2_1
+#if !MOBILE
[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
#endif
\ No newline at end of file
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
[assembly: InternalsVisibleTo ("System.Windows, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
[assembly: InternalsVisibleTo ("System.Windows.Browser, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.Runtime.InteropServices;
namespace System.Net.NetworkInformation {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.NetworkInformation {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections.Generic;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections.Generic;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections.Generic;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections.Generic;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections.Generic;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections.Generic;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Policy {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.Security;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Policy {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Policy {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Sockets {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Sockets {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Sockets {
public enum SocketAsyncOperation {
None,
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Sockets {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Sockets {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net.Sockets {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.IO;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net {
public enum WebExceptionStatus {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System;
using System.Collections;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.Collections.Generic;
using System.IO;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.IO;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.ComponentModel;
using System.IO;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Net
{
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../winfx.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: ComVisible (false)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile("../winfx.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../winfx.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: ComVisible (false)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile("../winfx.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../silverlight.pub")] // easing InternalVisibleTo use.
[assembly: ComVisible (false)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile("../winfx.pub")]
#endif
-#if NET_2_1
+#if MOBILE
[assembly: InternalsVisibleTo ("System.Json, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo ("System.ServiceModel.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo ("System.Windows.Browser, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
}
public override string ContentType {
-#if NET_2_1
+#if MOBILE
get { return MediaType; }
#else
get { return MediaType + "; charset=" + source.WriteEncoding.HeaderName; }
break;
case WebContentFormat.Json:
// FIXME: is it safe/unsafe/required to keep XmlReader open?
-#if NET_2_1
+#if MOBILE
msg = Message.CreateMessage (MessageVersion.None, null, JsonReaderWriterFactory.CreateJsonReader (stream, source.ReaderQuotas));
#else
msg = Message.CreateMessage (MessageVersion.None, null, JsonReaderWriterFactory.CreateJsonReader (stream, enc, source.ReaderQuotas, null));
switch (GetContentFormat (message)) {
case WebContentFormat.Xml:
-#if NET_2_1
+#if MOBILE
using (XmlWriter w = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (new StreamWriter (stream, source.WriteEncoding))))
message.WriteMessage (w);
#else
namespace System.ServiceModel.Channels
{
public sealed class WebMessageEncodingBindingElement
-#if NET_2_1
+#if MOBILE
: MessageEncodingBindingElement
#else
: MessageEncodingBindingElement, IWsdlExportExtension
return base.BuildChannelFactory<TChannel> (context);
}
-#if !NET_2_1
+#if !MOBILE
[MonoTODO ("Why is it overriden?")]
public override bool CanBuildChannelListener<TChannel> (BindingContext context)
{
return context.GetInnerProperty<T> ();
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
void IWsdlExportExtension.ExportContract (WsdlExporter exporter, WsdlContractConversionContext context)
{
// clientRuntime.MessageInspectors.Add (something);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
protected virtual void AddServerErrorHandlers (ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add (new WebHttpErrorHandler ());
public virtual void ApplyDispatchBehavior (ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
endpointDispatcher.DispatchRuntime.OperationSelector = GetOperationSelector (endpoint);
}
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
internal class DispatchPairFormatter : IDispatchMessageFormatter
{
public DispatchPairFormatter (IDispatchMessageFormatter request, IDispatchMessageFormatter reply)
return new WebMessageFormatter.ReplyClientFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
}
-#if !NET_2_1
+#if !MOBILE
protected virtual IDispatchMessageFormatter GetReplyDispatchFormatter (OperationDescription operationDescription, ServiceEndpoint endpoint)
{
return new WebMessageFormatter.ReplyDispatchFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
return new WebMessageFormatter.RequestClientFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
}
-#if !NET_2_1
+#if !MOBILE
protected virtual IDispatchMessageFormatter GetRequestDispatchFormatter (OperationDescription operationDescription, ServiceEndpoint endpoint)
{
return new WebMessageFormatter.RequestDispatchFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
throw new InvalidOperationException ("ManualAddressing in the transport binding element in the binding must be true for WebHttpBehavior");
}
-#if !NET_2_1
+#if !MOBILE
internal class WebHttpErrorHandler : IErrorHandler
{
public void ProvideFault (Exception error, MessageVersion version, ref Message fault)
using System.Text;
using System.Xml;
-#if NET_2_1
+#if MOBILE
using XmlObjectSerializer = System.Object;
#endif
this.converter = converter;
this.behavior = behavior;
ApplyWebAttribute ();
-#if !NET_2_1
+#if !MOBILE
// This is a hack for WebScriptEnablingBehavior
var jqc = converter as JsonQueryStringConverter;
if (jqc != null)
protected object ReadObjectBody (XmlObjectSerializer serializer, XmlReader reader)
{
-#if NET_2_1
+#if MOBILE
return (serializer is DataContractJsonSerializer) ?
((DataContractJsonSerializer) serializer).ReadObject (reader) :
((DataContractSerializer) serializer).ReadObject (reader, true);
}
}
-#if !NET_2_1
+#if !MOBILE
internal class RequestDispatchFormatter : WebDispatchMessageFormatter
{
public RequestDispatchFormatter (OperationDescription operation, ServiceEndpoint endpoint, QueryStringConverter converter, WebHttpBehavior behavior)
// FIXME: get encoding from somewhere
hp.Headers ["Content-Type"] = mediaType + "; charset=utf-8";
-#if !NET_2_1
+#if !MOBILE
if (WebOperationContext.Current != null)
WebOperationContext.Current.OutgoingRequest.Apply (hp);
#endif
throw new ArgumentNullException ("parameters");
CheckMessageVersion (message.Version);
-#if !NET_2_1
+#if !MOBILE
if (OperationContext.Current != null) {
// Set response in the context
OperationContext.Current.IncomingMessage = message;
object value;
XmlObjectSerializer serializer;
-#if !NET_2_1
+#if !MOBILE
protected override BodyWriter OnCreateBufferedCopy (int maxBufferSize)
{
return new WrappedBodyWriter (value, serializer, name, ns, fmt);
void WriteObject (XmlObjectSerializer serializer, XmlDictionaryWriter writer, object value)
{
if (serializer != null){
-#if NET_2_1
+#if MOBILE
if (serializer is DataContractJsonSerializer)
((DataContractJsonSerializer) serializer).WriteObject (writer, value);
else
}
}
-#if !NET_2_1
+#if !MOBILE
internal abstract class WebDispatchMessageFormatter : WebMessageFormatter, IDispatchMessageFormatter
{
protected WebDispatchMessageFormatter (OperationDescription operation, ServiceEndpoint endpoint, QueryStringConverter converter, WebHttpBehavior behavior)
{
public class WebChannelFactory<TChannel> : ChannelFactory<TChannel>
{
-#if !NET_2_1
+#if !MOBILE
public WebChannelFactory ()
: base ()
{
protected override void OnOpening ()
{
-#if !NET_2_1
+#if !MOBILE
if (Endpoint.Behaviors.Find<WebHttpBehavior> () == null)
Endpoint.Behaviors.Add (new WebHttpBehavior ());
#endif
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
-#if NET_2_1 // Note that moonlight System.ServiceModel.Web.dll does not contain this class.
+#if MOBILE // Note that moonlight System.ServiceModel.Web.dll does not contain this class.
using IncomingWebRequestContext = System.Object;
using OutgoingWebResponseContext = System.Object;
#else
namespace System.ServiceModel.Web
{
public class WebOperationContext
-#if !NET_2_1
+#if !MOBILE
: IExtension<OperationContext>
#endif
{
-#if !NET_2_1
+#if !MOBILE
public static WebOperationContext Current {
get {
if (OperationContext.Current == null)
outgoing_request = new OutgoingWebRequestContext ();
incoming_response = new IncomingWebResponseContext (operation);
-#if !NET_2_1
+#if !MOBILE
incoming_request = new IncomingWebRequestContext (operation);
outgoing_response = new OutgoingWebResponseContext ();
#endif
}
-#if !NET_2_1
+#if !MOBILE
public IncomingWebRequestContext IncomingRequest {
get { return incoming_request; }
}
get { return outgoing_request; }
}
-#if !NET_2_1
+#if !MOBILE
public OutgoingWebResponseContext OutgoingResponse {
get { return outgoing_response; }
}
using System.ServiceModel.Channels;
using System.Text;
using System.Xml;
-#if !NET_2_1
+#if !MOBILE
using System.Configuration;
using System.ServiceModel.Configuration;
#endif
public WebHttpBinding (string configurationName)
{
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
BindingsSection bindingsSection = ConfigUtil.BindingsSection;
WebHttpBindingElement el = (WebHttpBindingElement) bindingsSection ["webHttpBinding"].ConfiguredBindings.FirstOrDefault (c => c.Name == configurationName);
if (el != null) {
get { return EnvelopeVersion.None; }
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[DefaultValue (false)]
public bool AllowCookies {
get { return t.AllowCookies; }
public WebHttpSecurity ()
{
// there is no public constructor for transport ...
-#if !NET_2_1
+#if !MOBILE
Transport = new BasicHttpBinding ().Security.Transport;
#endif
}
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../winfx.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: ComVisible (false)]
-#if NET_2_1
+#if MOBILE
//[assembly: InternalsVisibleTo ("System.Xml.Serialization, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#endif
-#if !NET_2_1
+#if !MOBILE
[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo ("System.ServiceModel.Routing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo ("System.ServiceModel.Discovery, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] // AnnouncementChannelEndpointElementCollection requires it.
AppDomain myDomain = System.Threading.Thread.GetDomain();
AssemblyName myAsmName = new AssemblyName();
myAsmName.Name = name;
-#if NET_2_1
+#if MOBILE
AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly (myAsmName, AssemblyBuilderAccess.Run);
#else
AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly (myAsmName, AssemblyBuilderAccess.RunAndSave);
{
if (!isInitialized)
{
-#if !NET_2_1
+#if !MOBILE
Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
// Debug.Listeners.Add(new TextWriterTraceListener(@"c:\ssl.log"));
Debug.AutoFlush = true;
return base.BuildChannelFactory<TChannel> (context);
}
-#if !NET_2_1
+#if !MOBILE
public override IChannelListener<TChannel> BuildChannelListener<TChannel> (
BindingContext context)
{
return new BinaryMessageEncoderFactory (this);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
void IWsdlExportExtension.ExportContract (WsdlExporter exporter,
WsdlContractConversionContext context)
return CreateContext (parameters).BuildInnerChannelFactory<TChannel> ();
}
-#if !NET_2_1
+#if !MOBILE
public virtual IChannelListener<TChannel>
BuildChannelListener<TChannel> (
Uri listenUriBaseAddress,
return CreateContext (parameters).CanBuildInnerChannelFactory<TChannel> ();
}
-#if !NET_2_1
+#if !MOBILE
public bool CanBuildChannelListener<TChannel> (
params object [] parameters)
where TChannel : class, IChannel
return ctx.DequeueBindingElement ().BuildChannelFactory<TChannel> (ctx);
}
-#if !NET_2_1
+#if !MOBILE
public IChannelListener<TChannel>
BuildInnerChannelListener<TChannel> ()
where TChannel : class, IChannel
return ctx.DequeueBindingElement ().CanBuildChannelFactory<TChannel> (ctx);
}
-#if !NET_2_1
+#if !MOBILE
public bool CanBuildInnerChannelListener<TChannel> ()
where TChannel : class, IChannel
{
return context.BuildInnerChannelFactory<TChannel> ();
}
-#if !NET_2_1
+#if !MOBILE
public virtual IChannelListener<TChannel>
BuildChannelListener<TChannel> (
BindingContext context)
return context.CanBuildInnerChannelFactory<TChannel> ();
}
-#if !NET_2_1
+#if !MOBILE
public virtual bool CanBuildChannelListener<TChannel> (
BindingContext context)
where TChannel : class, IChannel
var f = mbe.CreateMessageEncoderFactory ();
var t = typeof (TChannel);
if (t == typeof (IRequestSessionChannel) ||
-#if !NET_2_1
+#if !MOBILE
t == typeof (IReplySessionChannel) ||
#endif
t == typeof (IInputSessionChannel) ||
OperationContext ctx = OperationContext.Current;
// FIXME: support more fault code depending on the exception type.
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
// FIXME: set correct fault reason.
if (ctx != null && ctx.EndpointDispatcher.ChannelDispatcher.IncludeExceptionDetailInFaults) {
ExceptionDetail detail = new ExceptionDetail (error);
get { return source.MessageEncoder; }
}
-#if NET_2_1
+#if MOBILE
public override T GetProperty<T> ()
{
if (typeof (T) == typeof (IHttpCookieContainerManager))
suppressEntityBody = true;
}
-#if !NET_2_1
+#if !MOBILE
if (source.ClientCredentials != null) {
var cred = source.ClientCredentials;
if ((cred.ClientCertificate != null) && (cred.ClientCertificate.Certificate != null))
// FIXME: Do we need to use the timeout? If so, what happens when the timeout is reached.
// Is the current request cancelled and an exception thrown? If so we need to pass the
// exception to the Complete () method and allow the result to complete 'normally'.
-#if NET_2_1
+#if MOBILE
// neither Moonlight nor MonoTouch supports contexts (WaitOne default to false)
bool result = AsyncWaitHandle.WaitOne (Timeout);
#else
using System.Net.Security;
using System.Security.Authentication.ExtendedProtection;
using System.ServiceModel.Channels;
-#if !NET_2_1
+#if !MOBILE
using System.ServiceModel.Channels.Http;
#endif
using System.ServiceModel.Description;
return typeof (TChannel) == typeof (IRequestChannel);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public override bool CanBuildChannelListener<TChannel> (
BindingContext context)
{
return new HttpChannelFactory<TChannel> (this, context);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
internal static object ListenerBuildLock = new object ();
public override IChannelListener<TChannel> BuildChannelListener<TChannel> (
set { throw new NotImplementedException (); }
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
void IPolicyExportExtension.ExportPolicy (
MetadataExporter exporter,
PolicyConversionContext context)
return base.BuildChannelFactory <TChannel> (context);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
public override IChannelListener<TChannel>
BuildChannelListener<TChannel> (
return new HttpsTransportBindingElement (this);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public XmlElement GetTransportTokenAssertion ()
{
var doc = new XmlDocument ();
[MonoTODO]
public sealed class LocalClientSecuritySettings
{
-#if !NET_2_1
+#if !MOBILE
bool cache_cookies = true;
int cookie_renewal = 60;
bool detect_replays = true;
public TimeSpan ReplayWindow { get; set; }
public TimeSpan TimestampValidityDuration { get; set; }
-#if !NET_2_1
+#if !MOBILE
public bool CacheCookies {
get { return cache_cookies; }
set { cache_cookies = value; }
}
}
-#if !NET_2_1
+#if !MOBILE
internal class XPathMessageBuffer : MessageBuffer
{
IXPathNavigable source;
return ctx.GetInnerProperty<T> ();
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
protected virtual void OnImportPolicy (XmlElement assertion,
MessageVersion messageVersion,
{
bool is_ref, must_understand, relay;
string actor;
-#if NET_2_1
+#if MOBILE
string body;
#else
// This is required to completely clone body xml that
local_name = reader.LocalName;
namespace_uri = reader.NamespaceURI;
-#if NET_2_1
+#if MOBILE
body = reader.ReadOuterXml ();
#else
body = new XmlDocument ();
public XmlReader CreateReader ()
{
-#if NET_2_1
+#if MOBILE
var reader = XmlReader.Create (new StringReader (body));
#else
var reader = new XmlNodeReader (body);
return;
if (MessageVersion.Addressing.Equals (AddressingVersion.WSAddressing10))
Add (MessageHeader.CreateHeader (name, ns, EndpointAddress10.FromEndpointAddress (address)));
-#if !NET_2_1
+#if !MOBILE
else if (MessageVersion.Addressing.Equals (AddressingVersion.WSAddressingAugust2004))
Add (MessageHeader.CreateHeader (name, ns, EndpointAddressAugust2004.FromEndpointAddress (address)));
#endif
}
}
-#if !NET_2_1
+#if !MOBILE
public SecurityMessageProperty Security {
get { return (SecurityMessageProperty) this ["Security"]; }
set { this ["Security"] = value; }
throw new NotImplementedException ();
}
-#if !NET_2_1
+#if !MOBILE
[MonoTODO]
public override IChannelListener<TChannel> BuildChannelListener<TChannel> (BindingContext context)
{
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.ServiceModel.Security;
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
using System.ServiceModel.Channels.Security;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
{
MessageSecurityVersion = MessageSecurityVersion.Default;
endpoint = new SupportingTokenParameters ();
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
DefaultAlgorithmSuite = SecurityAlgorithmSuite.Default;
KeyEntropyMode = SecurityKeyEntropyMode.CombinedEntropy;
operation = new Dictionary<string,SupportingTokenParameters> ();
security_header_layout = other.security_header_layout;
msg_security_version = other.msg_security_version;
endpoint = other.endpoint.Clone ();
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
alg_suite = other.alg_suite;
key_entropy_mode = other.key_entropy_mode;
opt_endpoint = other.opt_endpoint.Clone ();
MessageSecurityVersion msg_security_version;
SupportingTokenParameters endpoint;
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
SecurityAlgorithmSuite alg_suite;
SecurityKeyEntropyMode key_entropy_mode;
SupportingTokenParameters opt_endpoint;
get { return endpoint; }
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public SecurityAlgorithmSuite DefaultAlgorithmSuite {
get { return alg_suite; }
set { alg_suite = value; }
[MonoTODO ("Implement for TransportSecurityBindingElement")]
public override bool CanBuildChannelFactory<TChannel> (BindingContext context)
{
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
// not sure this should be like this, but there isn't Symmetric/Asymmetric elements in 2.1 anyways.
return context.CanBuildInnerChannelFactory<TChannel> ();
#else
protected abstract IChannelFactory<TChannel>
BuildChannelFactoryCore<TChannel> (BindingContext context);
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO ("Implement for TransportSecurityBindingElement")]
public override bool CanBuildChannelListener<TChannel> (BindingContext context)
{
#endif
#region Factory methods
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public static SymmetricSecurityBindingElement
CreateAnonymousForCertificateBindingElement ()
{
SecurityBindingElement binding, bool requireCancellation,
ChannelProtectionRequirements protectionRequirements)
{
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
SymmetricSecurityBindingElement be =
new SymmetricSecurityBindingElement ();
be.ProtectionTokenParameters =
CreateUserNameOverTransportBindingElement ()
{
var be = new TransportSecurityBindingElement ();
-#if !NET_2_1 && !XAMMAC_4_5 // FIXME: there should be whatever else to do for 2.1 instead.
+#if !MOBILE && !XAMMAC_4_5 // FIXME: there should be whatever else to do for 2.1 instead.
be.EndpointSupportingTokenParameters.SignedEncrypted.Add (new UserNameSecurityTokenParameters ());
#endif
return be;
}
#endregion
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
// It seems almost internal, hardcoded like this (I tried
// custom parameters that sets IssuedTokenSecurityTokenParameters
// like below ones, but that didn't trigger this method).
return base.BuildChannelFactory<TChannel> (context);
}
-#if !NET_2_1
+#if !MOBILE
public override IChannelListener<TChannel> BuildChannelListener<TChannel> (
BindingContext context)
{
return new TextMessageEncoderFactory (this);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
protected override void OnImportPolicy (XmlElement assertion,
MessageVersion messageVersion,
q.MaxStringContentLength = (int) MaxReceivedMessageSize;
return (T) (object) q;
}
-#if !NET_2_1
+#if !MOBILE
if (typeof (T) == typeof (ChannelProtectionRequirements))
// blank one, basically it should not be used
// for any secure channels (
return context.GetInnerProperty<T> ();
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
internal static XmlElement CreateTransportBinding (XmlElement transportToken)
{
var doc = new XmlDocument ();
namespace System.ServiceModel.Channels
{
public sealed class TransportSecurityBindingElement
-#if NET_2_1
+#if MOBILE
: SecurityBindingElement
#else
: SecurityBindingElement, IPolicyExportExtension
throw new NotImplementedException ();
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
protected override IChannelListener<TChannel>
BuildChannelListenerCore<TChannel> (
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Security;
-#if !NET_2_1
+#if !MOBILE
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
using System.ServiceModel.Security.Tokens;
namespace System.ServiceModel.Description
{
public class ClientCredentials
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
: IEndpointBehavior
#else
: SecurityCredentialsManager, IEndpointBehavior
initiator = source.initiator.Clone ();
recipient = source.recipient.Clone ();
windows = source.windows.Clone ();
-#if !NET_2_1
+#if !MOBILE
issued_token = source.issued_token.Clone ();
peer = source.peer.Clone ();
support_interactive = source.support_interactive;
get { return windows; }
}
-#if !NET_2_1
+#if !MOBILE
IssuedTokenClientCredential issued_token =
new IssuedTokenClientCredential ();
PeerCredential peer = new PeerCredential ();
return new ClientCredentials (this);
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public override SecurityTokenManager CreateSecurityTokenManager ()
{
return new ClientCredentialsSecurityTokenManager (this);
var fname = a.Name ?? a.DetailType.Name + "Fault";
var fns = a.Namespace ?? cd.Namespace;
var fd = new FaultDescription (a.Action ?? cd.Namespace + cd.Name + "/" + od.Name + fname) { DetailType = a.DetailType, Name = fname, Namespace = fns };
-#if !NET_2_1
+#if !MOBILE
if (a.HasProtectionLevel)
fd.ProtectionLevel = a.ProtectionLevel;
#endif
foreach (object obj in serviceMethod.GetCustomAttributes (typeof(IOperationBehavior),true))
od.Behaviors.Add ((IOperationBehavior) obj);
}
-#if !NET_2_1
+#if !MOBILE
if (od.Behaviors.Find<OperationBehaviorAttribute>() == null)
od.Behaviors.Add (new OperationBehaviorAttribute ());
#endif
public int MaxItemsInObjectGraph { get; set; }
-#if !NET_2_1
+#if !MOBILE
public IDataContractSurrogate DataContractSurrogate { get; set; }
#endif
public virtual XmlObjectSerializer CreateSerializer (Type type, string name, string ns, IList<Type> knownTypes)
{
-#if NET_2_1
+#if MOBILE
return new DataContractSerializer (type, name, ns, knownTypes);
#else
return new DataContractSerializer (type, name, ns, knownTypes, MaxItemsInObjectGraph, IgnoreExtensionDataObject, false, DataContractSurrogate);
public virtual XmlObjectSerializer CreateSerializer (Type type, XmlDictionaryString name, XmlDictionaryString ns, IList<Type> knownTypes)
{
-#if NET_2_1
+#if MOBILE
return new DataContractSerializer (type, name, ns, knownTypes);
#else
return new DataContractSerializer (type, name, ns, knownTypes, MaxItemsInObjectGraph, IgnoreExtensionDataObject, false, DataContractSurrogate);
{
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
//IWsdlExportExtension
void IWsdlExportExtension.ExportContract (WsdlExporter exporter,
set { type = value; }
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
internal XsdDataContractImporter DataContractImporter { get; set; }
internal XmlSerializerMessageContractImporterInternal XmlSerializationImporter { get; set; }
internal System.CodeDom.CodeTypeReference CodeTypeReference { get; set; }
{
public class XmlSerializerOperationBehavior
: IOperationBehavior
-#if !NET_2_1
+#if !MOBILE
, IWsdlExportExtension
#endif
{
{
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
void IWsdlExportExtension.ExportContract (
WsdlExporter exporter,
WsdlContractConversionContext context)
{
public MessageLoggingSettings ()
{
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
var e = ConfigUtil.DiagnosticSection.MessageLogging;
LogEntireMessage = e.LogEntireMessage;
LogKnownPii = e.LogKnownPii;
var headers = MessageToHeaderObjects (md, message);
object [] parts = MessageToParts (md, message);
if (md.MessageType != null) {
-#if NET_2_1
+#if MOBILE
parameters [0] = Activator.CreateInstance (md.MessageType);
#else
parameters [0] = Activator.CreateInstance (md.MessageType, true);
var headers = MessageToHeaderObjects (md, message);
object [] parts = MessageToParts (md, message);
if (md.MessageType != null) {
-#if NET_2_1
+#if MOBILE
object msgObject = Activator.CreateInstance (md.MessageType);
#else
object msgObject = Activator.CreateInstance (md.MessageType, true);
class DataContractMessagesFormatter : BaseMessagesFormatter
{
DataContractFormatAttribute attr;
-#if !NET_2_1
+#if !MOBILE
DataContractSerializerOperationBehavior serializerBehavior;
#endif
public DataContractMessagesFormatter (OperationDescription desc, DataContractFormatAttribute attr)
: base (desc)
{
-#if !NET_2_1
+#if !MOBILE
this.serializerBehavior = desc.Behaviors.Find<DataContractSerializerOperationBehavior>();
#endif
this.attr = attr;
XmlObjectSerializer GetSerializer (MessagePartDescription partDesc)
{
if (!serializers.ContainsKey (partDesc))
-#if !NET_2_1
+#if !MOBILE
if (serializerBehavior != null)
serializers [partDesc] = serializerBehavior.CreateSerializer(
partDesc.Type, partDesc.Name, partDesc.Namespace, OperationKnownTypes as IList<Type>);
public sealed class ClientOperation
{
internal class ClientOperationCollection :
-#if NET_2_1
+#if MOBILE
KeyedCollection<string, ClientOperation>
#else
SynchronizedKeyedCollection<string, ClientOperation>
{
contract_name = name;
contract_ns = ns;
-#if !NET_2_1
+#if !MOBILE
CallbackDispatchRuntime = (DispatchRuntime) callbackDispatchRuntime ?? new DispatchRuntime (null, this);
#endif
}
public Type ContractClientType { get; set; }
-#if !NET_2_1
+#if !MOBILE
public DispatchRuntime CallbackDispatchRuntime { get; internal set; }
#endif
get { return inspectors; }
}
-#if NET_2_1
+#if MOBILE
public KeyedCollection<string,ClientOperation> Operations {
get { return operations; }
}
tx_auto_complete, tx_required,
auto_dispose_params = true;
IDispatchMessageFormatter formatter;
-#if !NET_2_1
+#if !MOBILE
ImpersonationOption impersonation;
IOperationInvoker invoker;
SynchronizedCollection<IParameterInspector> inspectors
get { return action; }
}
-#if !NET_2_1
+#if !MOBILE
public SynchronizedCollection<ICallContextInitializer> CallContextInitializers {
get { return ctx_initializers; }
}
void ThrowIfOpened ()
{
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
// FIXME: get callback client runtime status when ChannelDispatcher is not available.
var state = Parent.ChannelDispatcher != null ? Parent.ChannelDispatcher.State : CommunicationState.Created; // Parent.CallbackClientRuntime.ChannelFactory.State;
switch (state) {
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
-#if !NET_2_1
+#if !MOBILE
using System.IdentityModel.Policy;
#if !XAMMAC_4_5
using System.Web.Security;
{
public sealed class DispatchRuntime
{
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
internal DispatchRuntime (EndpointDispatcher dispatcher, ClientRuntime callbackClientRuntime)
{
UnhandledDispatchOperation = new DispatchOperation (
StoreName storeName, X509FindType findType,
object findValue)
{
-#if !NET_2_1
+#if !MOBILE
certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
#else
throw new NotImplementedException ();
string subjectName, StoreLocation storeLocation,
StoreName storeName)
{
-#if !NET_2_1
+#if !MOBILE
certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName);
#else
throw new NotImplementedException ();
//
using System;
using System.Collections.Generic;
-#if !NET_2_1
+#if !MOBILE
using System.IdentityModel.Selectors;
#endif
using System.Security.Cryptography.X509Certificates;
X509Certificate2 certificate;
Dictionary<Uri,X509Certificate2> scoped =
new Dictionary<Uri,X509Certificate2> ();
-#if !NET_2_1
+#if !MOBILE
X509CertificateValidator validator;
#endif
X509RevocationMode revocation_mode;
public void SetDefaultCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType, Object findValue)
{
-#if !NET_2_1
+#if !MOBILE
DefaultCertificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
#else
throw new NotImplementedException ();
StoreName storeName, X509FindType findType,
Object findValue, Uri targetService)
{
-#if !NET_2_1
+#if !MOBILE
ScopedCertificates [targetService] = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
#else
throw new NotImplementedException ();
{
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public BasicHttpBinding (string configurationName)
: this ()
{
SecurityBindingElement element;
switch (Security.Mode) {
case BasicHttpSecurityMode.Message:
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
if (Security.Message.ClientCredentialType != BasicHttpMessageCredentialType.Certificate)
#endif
case BasicHttpSecurityMode.TransportWithMessageCredential:
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
if (Security.Message.ClientCredentialType != BasicHttpMessageCredentialType.Certificate)
return null;
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
element.SetKeyDerivation (false);
element.SecurityHeaderLayout = SecurityHeaderLayout.Lax;
#endif
ReaderQuotas.CopyTo (tm.ReaderQuotas);
return tm;
} else {
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
return new MtomMessageEncodingBindingElement (
{
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public BasicHttpsBinding (string configurationName)
: this ()
{
SecurityBindingElement element;
switch (Security.Mode) {
case BasicHttpsSecurityMode.TransportWithMessageCredential:
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
return null;
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
element.SetKeyDerivation (false);
element.SecurityHeaderLayout = SecurityHeaderLayout.Lax;
#endif
ReaderQuotas.CopyTo (tm.ReaderQuotas);
return tm;
} else {
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
return new MtomMessageEncodingBindingElement (
if (endpointConfig == null)
return;
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
try {
// It should automatically use XmlXapResolver
var cfg = new SilverlightClientConfigLoader ().Load (XmlReader.Create ("ServiceReferences.ClientConfig"));
#endif
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
private void ApplyBehavior (string behaviorConfig)
{
BehaviorsSection behaviorsSection = ConfigUtil.BehaviorsSection;
new BindingParameterCollection ();
ContractDescription cd = Endpoint.Contract;
-#if !NET_2_1
+#if !MOBILE
pl.Add (ChannelProtectionRequirements.CreateFromContract (cd));
#endif
string modname = "dummy";
Type crtype =
-#if !NET_2_1
+#if !MOBILE
duplex ? typeof (DuplexClientRuntimeChannel) :
#endif
typeof (ClientRuntimeChannel);
BindingFlags bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
foreach (OperationDescription od in cd.Operations) {
// FIXME: handle properties and events.
-#if !NET_2_1
+#if !MOBILE
if (od.SyncMethod != null)
GenerateMethodImpl (c, crtype.GetMethod ("Process", bf), od.Name, od.SyncMethod);
#endif
{
if (CanCastTo<IClientChannel> (t))
return true;
-#if !NET_2_1
+#if !MOBILE
if (isDuplex && CanCastTo<IDuplexContextChannel> (t))
return true;
#endif
using System.Xml.Serialization;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
-#if !NET_2_1
+#if !MOBILE
using System.Security.Cryptography.Xml;
#endif
get { return address; }
}
-#if !NET_2_1
+#if !MOBILE
internal static XmlSchema Schema {
get {
if (schema == null) {
return ! (address1 == address2);
}
-//#if !NET_2_1
+//#if !MOBILE
public static EndpointAddress ReadFrom (
XmlDictionaryReader reader)
{
addressingVersion.Namespace, reader.LocalName, reader.NamespaceURI));
reader.MoveToContent ();
-#if !NET_2_1
+#if !MOBILE
MetadataSet metadata = null;
if (reader.LocalName == "Metadata" &&
reader.NamespaceURI == addressingVersion.Namespace &&
if (addressingVersion == AddressingVersion.WSAddressing10 && uri == w3c_anonymous)
uri = anonymous_role;
-#if NET_2_1
+#if MOBILE
return new EndpointAddress (uri, identity);
#else
if (metadata == null)
{
if (writer == null)
throw new ArgumentNullException ("writer");
-#if NET_2_1
+#if MOBILE
if (addressingVersion == AddressingVersion.None) {
writer.WriteString (Uri.AbsoluteUri);
} else {
{
[XmlSchemaProvider ("GetSchema")]
[XmlRoot ("EndpointReference", Namespace = "http://www.w3.org/2005/08/addressing")]
-#if NET_2_1
+#if MOBILE
internal class EndpointAddress10 : IXmlSerializable
#else
public class EndpointAddress10 : IXmlSerializable
set { identity = value; }
}
-#if !NET_2_1
+#if !MOBILE
public XmlDictionaryReader GetReaderAtExtensions ()
{
if (extension == null)
internal static class Logger
{
-#if NET_2_1
+#if MOBILE
enum TraceEventType // dummy
{
Critical,
static int event_id;
static TextWriter log_writer;
static XmlWriter xml_writer;
-#if !NET_2_1
+#if !MOBILE
static readonly TraceSource source = new TraceSource ("System.ServiceModel");
static readonly TraceSource message_source = new TraceSource ("System.ServiceModel.MessageLogging");
#endif
case "stderr":
log_writer = Console.Error;
break;
-#if !NET_2_1
+#if !MOBILE
default:
try {
if (!String.IsNullOrEmpty (env))
if (log_writer != null)
xml_writer = XmlWriter.Create (log_writer, new XmlWriterSettings () { OmitXmlDeclaration = true });
-#if !NET_2_1
+#if !MOBILE
message_source.Switch.Level = SourceLevels.Information;
#endif
}
if (log_writer != null) {
lock (log_writer){
event_id++;
-#if NET_2_1
+#if MOBILE
log_writer.Write ("[{0}] ", event_id);
#endif
TraceCore (TraceEventType.Information, event_id,
message, args);
log_writer.WriteLine (message, args);
log_writer.Flush ();
-#if !NET_2_1
+#if !MOBILE
source.TraceEvent (eventType, event_id, message, args);
#endif
}
{
if (log_writer != null) {
var sw = new StringWriter ();
-#if NET_2_1
+#if MOBILE
var xw = XmlWriter.Create (sw, xws);
#else
var doc = new XmlDocument ();
event_id++;
lock (log_writer){
-#if NET_2_1
+#if MOBILE
log_writer.Write ("[{0}] ", event_id);
TraceCore (TraceEventType.Information, event_id, /*FIXME*/false, /*FIXME*/Guid.Empty, sw);
}
Message incoming_message;
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
EndpointDispatcher dispatcher;
#endif
IContextChannel channel;
}
-#if !NET_2_1 && !XAMMAC_4_5
+#if !MOBILE && !XAMMAC_4_5
public EndpointDispatcher EndpointDispatcher {
get { return dispatcher; }
set { dispatcher = value; }
get { return Channel.SessionId; }
}
-#if !NET_2_1
+#if !MOBILE
public ServiceSecurityContext ServiceSecurityContext {
get { return IncomingMessageProperties != null ? IncomingMessageProperties.Security.ServiceSecurityContext : null; }
}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1 || XAMMAC_4_5
+#if MOBILE || XAMMAC_4_5
using System;
using System.Collections.Generic;
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
// ThrowIfDisposed throws an exception if the state is Closing, Closed or Faulted.
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
// ThrowIfDisposedOrImmutable throws an exception if the state is not Created.
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
// ThrowIfDisposedOrNotOpen throws an exception if the state is not Opened.
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
}
[TestMethod]
-#if NET_2_1
+#if MOBILE
[MoonlightBug]
#else
[NUnit.Framework.Ignore]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
#endif
-#if NET_2_1
+#if MOBILE
[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
#else
[assembly: AllowPartiallyTrustedCallers]
LIB_MCS_FLAGS = -nowarn:219,414,649,1717 -unsafe -d:ASYNC
ifeq (2.1, $(FRAMEWORK_VERSION))
-LIB_MCS_FLAGS += -d:AGCLR -d:NET_2_1_HACK -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE
+LIB_MCS_FLAGS += -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE
endif
TEST_LIB_REFS = System.Data System.Core
set { memberName = value; }
}
-#if NET_2_1
+#if MOBILE
MemberInfo member;
// It is used only in 2.1 S.X.Serialization.dll in MS SDK.
internal MemberInfo MemberInfo {
{
get { return _mapMember.Name; }
}
-#if !NET_2_1
+#if !MOBILE
public string GenerateTypeName (System.CodeDom.Compiler.CodeDomProvider codeProvider)
{
string ret = codeProvider.CreateValidIdentifier (_mapMember.TypeData.FullTypeName);
mps.RelatedMaps = relatedMaps;
mps.Format = SerializationFormat.Literal;
Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null;
-#if !NET_2_1
+#if !MOBILE
mps.Source = new MembersSerializationSource (elementName, hasWrapperElement, members, false, true, ns, extraTypes);
if (allowPrivateTypes) mps.Source.CanBeGenerated = false;
#endif
map.RelatedMaps = relatedMaps;
map.Format = SerializationFormat.Literal;
Type[] extraTypes = includedTypes != null ? (Type[]) includedTypes.ToArray (typeof (Type)) : null;
-#if !NET_2_1
+#if !MOBILE
map.Source = new XmlTypeSerializationSource (typeData.Type, root, attributeOverrides, defaultNamespace, extraTypes);
if (allowPrivateTypes) map.Source.CanBeGenerated = false;
#endif
using System.Xml;
using System.Xml.Schema;
using System.Text;
-#if !NET_2_1
+#if !MOBILE
using System.CodeDom;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
// debugging pourposes by adding the "nofallback" option.
// For example: MONO_XMLSERIALIZER_THS=0,nofallback
-#if NET_2_1
+#if MOBILE
string db = null;
string th = null;
generationThreshold = -1;
}
#endif
deleteTempFiles = (db == null || db == "no");
-#if !NET_2_1 && CONFIGURATION_DEP
+#if !MOBILE && CONFIGURATION_DEP
// DiagnosticsSection
ConfigurationSection table = (ConfigurationSection) ConfigurationSettings.GetConfig("system.diagnostics");
var bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
}
}
-#if !NET_2_1
+#if !MOBILE
if (!typeMapping.Source.CanBeGenerated || generationThreshold == -1)
return new XmlSerializationWriterInterpreter (typeMapping);
XmlSerializationReader CreateReader (XmlMapping typeMapping)
{
-#if !NET_2_1
+#if !MOBILE
XmlSerializationReader reader;
lock (this) {
return new XmlSerializationReaderInterpreter (typeMapping);
}
-#if NET_2_1
+#if MOBILE
void CheckGeneratedTypes (XmlMapping typeMapping)
{
throw new NotImplementedException();
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
return TypeDescriptor.GetConverter (type);
}
- // FIXME: I want this to cover all the existing types and make it valid in both NET_2_1 and !NET_2_1.
+ // FIXME: I want this to cover all the existing types and make it valid in both MOBILE and !MOBILE.
class ConvertibleTypeConverter<T> : TypeConverter
{
Type type;
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../winfx.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
-#if !NET_2_1
+#if !MOBILE
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
#endif
#if !BOOTSTRAP_WITH_OLDLIB
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
#endif
#endif
-#if NET_2_1 && !MOBILE
+#if MOBILE && !MOBILE
[assembly: InternalsVisibleTo ("System.Net, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
#else
[assembly: InternalsVisibleTo ("System.ComponentModel.DataAnnotations, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
public string FileName {
get {
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, filename).Demand ();
}
public static FileVersionInfo GetVersionInfo (string fileName)
{
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.Read, fileName).Demand ();
}
return fvi;
}
- // use our own AppendFormat because NET_2_1 have only this overload
+ // use our own AppendFormat because MOBILE have only this overload
static void AppendFormat (StringBuilder sb, string format, params object [] args)
{
sb.AppendFormat (format, args);
namespace System.Diagnostics
{
-#if NET_2_1
+#if MOBILE
public class ProcessModuleCollectionBase : System.Collections.Generic.List<ProcessModule>
{
protected ProcessModuleCollectionBase InnerList {
#endif
public class ProcessModuleCollection :
-#if !NET_2_1
+#if !MOBILE
ReadOnlyCollectionBase
#else
ProcessModuleCollectionBase
namespace System.Diagnostics
{
-#if NET_2_1
+#if MOBILE
public class ProcessThreadCollectionBase : System.Collections.Generic.List<ProcessThread>
{
protected ProcessThreadCollectionBase InnerList {
#endif
public class ProcessThreadCollection :
-#if !NET_2_1
+#if !MOBILE
ReadOnlyCollectionBase
#else
ProcessThreadCollectionBase
if (Encoding.ASCII.Equals (enc))
return TransferEncoding.SevenBit;
else if (Encoding.UTF8.CodePage == enc.CodePage ||
-#if !NET_2_1
+#if !MOBILE
Encoding.Unicode.CodePage == enc.CodePage || Encoding.UTF32.CodePage == enc.CodePage
#else
Encoding.Unicode.CodePage == enc.CodePage
//
// Also note that catching ConfigurationErrorsException specifically would require library dependency
// System.Configuration, and wanted to avoid that.
-#if !NET_2_1
+#if !MOBILE
#if CONFIGURATION_DEP
try {
SettingsSection config;
public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
{
-#if NET_2_1 && !MOBILE
+#if MOBILE && !MOBILE
switch (addressFamily) {
case AddressFamily.InterNetwork: // ok
case AddressFamily.InterNetworkV6: // ok
if (error != 0)
throw new SocketException (error);
-#if !NET_2_1 || MOBILE
+#if !MOBILE || MOBILE
SocketDefaults ();
#endif
}
get { return ipv6_supported == 1; }
}
-#if NET_2_1
+#if MOBILE
public static bool OSSupportsIPv4 {
get { return ipv4_supported == 1; }
}
}
#endif
-#if NET_2_1
+#if MOBILE
public static bool OSSupportsIPv6 {
get { return ipv6_supported == 1; }
}
void ThrowIfUdp ()
{
-#if !NET_2_1 || MOBILE
+#if !MOBILE || MOBILE
if (protocol_type == ProtocolType.Udp)
throw new SocketException ((int)SocketError.ProtocolOption);
#endif
set;
}
-#if !NET_2_1
+#if !MOBILE
public TransmitFileOptions SendPacketsFlags {
get;
set;
return;
modules = new ArrayList ();
-#if NET_2_1
+#if MOBILE
modules.Add (new NtlmClient ());
modules.Add (new DigestClient ());
modules.Add (new BasicClient ());
}
}
-#if !NET_2_1
+#if !MOBILE
[MonoTODO]
public static new RequestCachePolicy DefaultCachePolicy
{
static HttpWebRequest ()
{
defaultMaxResponseHeadersLength = 64 * 1024;
-#if !NET_2_1
+#if !MOBILE
NetConfig config = ConfigurationSettings.GetConfig ("system.net/settings") as NetConfig;
if (config != null) {
int x = config.MaxResponseHeadersLength;
#endif
}
-#if NET_2_1
+#if MOBILE
public
#else
internal
SetSpecialHeaders(headerName, HttpProtocolUtils.date2string(dateTime));
}
-#if !NET_2_1
+#if !MOBILE
[MonoTODO]
public static new RequestCachePolicy DefaultCachePolicy
{
public const int DefaultPersistentConnectionLimit = 2;
#endif
-#if !NET_2_1
+#if !MOBILE
const string configKey = "system.net/connectionManagement";
static ConnectionManagementData manager;
#endif
static ServicePointManager ()
{
-#if !NET_2_1
+#if !MOBILE
#if CONFIGURATION_DEP
object cfg = ConfigurationManager.GetSection (configKey);
ConnectionManagementSection s = cfg as ConnectionManagementSection;
throw new ArgumentOutOfRangeException ("value");
defaultConnectionLimit = value;
-#if !NET_2_1
+#if !MOBILE
if (manager != null)
manager.Add ("*", defaultConnectionLimit);
#endif
throw new InvalidOperationException ("maximum number of service points reached");
int limit;
-#if NET_2_1
+#if MOBILE
limit = defaultConnectionLimit;
#else
string addr = address.ToString ();
//
using System.ComponentModel;
-#if !NET_2_1
+#if !MOBILE
using System.ComponentModel.Design.Serialization;
#endif
using System.Globalization;
return true;
if (type == typeof (Uri))
return true;
-#if NET_2_1
+#if MOBILE
return false;
#else
return (type == typeof (InstanceDescriptor));
public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value == null) {
-#if NET_2_1
+#if MOBILE
throw new NotSupportedException (Locale.GetText ("Cannot convert from value."));
#else
throw new ArgumentNullException ("value");
string s = (value as string);
if (s != null) {
-#if NET_2_1
+#if MOBILE
if (s == "")
return null;
#endif
return new Uri (s, UriKind.RelativeOrAbsolute);
}
-#if !NET_2_1
+#if !MOBILE
InstanceDescriptor id = (value as InstanceDescriptor);
if (id != null) {
return id.Invoke ();
return uri.ToString ();
if (destinationType == typeof (Uri))
return uri;
-#if !NET_2_1
+#if !MOBILE
if (destinationType == typeof (InstanceDescriptor)) {
ConstructorInfo ci = typeof (Uri).GetConstructor (new Type [2] { typeof (string), typeof (UriKind) });
return new InstanceDescriptor (ci , new object [] { uri.ToString (), uri.IsAbsoluteUri ? UriKind.Absolute : UriKind.Relative });
#endif
}
-#if NET_2_1
+#if MOBILE
throw new NotSupportedException (Locale.GetText ("Cannot convert to destination type."));
#else
return base.ConvertTo (context, culture, value, destinationType);
#endif
}
-#if !NET_2_1
+#if !MOBILE
public override bool IsValid (ITypeDescriptorContext context, object value)
{
if (value == null)
Assert.AreEqual(CM.CategoryAttribute.Key.Category, "Key", "#9");
Assert.AreEqual(CM.CategoryAttribute.Layout.Category, "Layout", "#10");
Assert.AreEqual(CM.CategoryAttribute.Mouse.Category, "Mouse", "#11");
-#if NET_2_1
+#if MOBILE
Assert.AreEqual(CM.CategoryAttribute.Default.Category, "Default", "#12");
Assert.AreEqual(CM.CategoryAttribute.DragDrop.Category, "DragDrop", "#13");
Assert.AreEqual(CM.CategoryAttribute.WindowStyle.Category, "WindowStyle", "#14");
ServicePointManager.MaxServicePoints = 0;\r
ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));\r
Assert.AreEqual (apacheUri, sp.Address, "#1");\r
-#if NET_2_1 && !MONODROID\r
+#if MOBILE && !MONODROID\r
Assert.AreEqual (10, sp.ConnectionLimit, "#2");\r
#else\r
Assert.AreEqual (2, sp.ConnectionLimit, "#2");\r
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
+#if MOBILE
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
trap "rm -f $(TMP_FILE1) $(TMP_FILE2)" EXIT INT QUIT TERM && \
sed 's/Environment\.GetResourceString/string.Format/g' ../referencesource/mscorlib/system/timezoneinfo.cs > $(TMP_FILE1) && \
sed 's/StringBuilder\.DefaultCapacity/100/g' ../referencesource/mscorlib/system/text/stringbuildercache.cs > $(TMP_FILE2) && \
- $(MCS) /debug+ /out:$@ -unsafe -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS) "/d:SELF_TEST;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MOBILE;MOBILE_DYNAMIC;MONODROID;ANDROID" $^ $(TMP_FILE1) $(TMP_FILE2)
+ $(MCS) /debug+ /out:$@ -unsafe -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS) "/d:SELF_TEST;NET_1_1;NET_2_0;MOBILE;NET_3_5;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MOBILE;MOBILE_DYNAMIC;MONODROID;ANDROID" $^ $(TMP_FILE1) $(TMP_FILE2)
android-pull-tzdb:
mkdir -p android/tzdb/usr/share/zoneinfo
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System;
using System.Text;
}
}
-#endif // NET_2_1
+#endif // MOBILE
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
namespace Microsoft.Win32
{
public enum RegistryKeyPermissionCheck
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System;
using System.Collections;
}
}
-#endif // NET_2_1
+#endif // MOBILE
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System;
using System.Collections;
}
}
-#endif // NET_2_1
+#endif // MOBILE
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System;
using System.Runtime.InteropServices;
}
}
-#endif // NET_2_1
+#endif // MOBILE
public virtual string GetFileName()
{
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled && (fileName != null) && (fileName.Length > 0)) {
string fn = Path.GetFullPath (fileName);
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fn).Demand ();
get { return territory; }
}
-#if !NET_2_1
+#if !MOBILE
// FIXME: It is implemented, but would be hell slow.
[ComVisible (false)]
public CultureTypes CultureTypes {
static DirectoryInfo CreateDirectoriesInternal (string path)
{
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, path).Demand ();
}
SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
string result = InsecureGetCurrentDirectory();
-#if !NET_2_1
+#if !MOBILE
if ((result != null) && (result.Length > 0) && SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, result).Demand ();
}
using System.Text;
using System.Runtime.InteropServices;
-#if !NET_2_1
+#if !MOBILE
using System.Security.AccessControl;
#endif
FileShare.None, bufferSize, options);
}
-#if !NET_2_1
+#if !MOBILE
[MonoLimitation ("FileOptions and FileSecurity are ignored")]
public static FileStream Create (string path, int bufferSize,
FileOptions options,
return MonoIO.ExistsFile (path, out error);
}
-#if !NET_2_1
+#if !MOBILE
public static FileSecurity GetAccessControl (string path)
{
// AccessControlSections.Audit requires special permissions.
}
}
-#if !NET_2_1
+#if !MOBILE
public static void SetAccessControl (string path,
FileSecurity fileSecurity)
{
using System.Threading;
using Microsoft.Win32.SafeHandles;
-#if NET_2_1
+#if MOBILE
using System.IO.IsolatedStorage;
#else
using System.Security.AccessControl;
throw new ArgumentOutOfRangeException ("bufferSize", "Positive number required.");
if (mode < FileMode.CreateNew || mode > FileMode.Append) {
-#if NET_2_1
+#if MOBILE
if (anonymous)
throw new ArgumentException ("mode", "Enum value was out of legal range.");
else
throw exc;
}
-#if !NET_2_1
+#if !MOBILE
public FileSecurity GetAccessControl ()
{
if (safeHandle.IsClosed)
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Win32.SafeHandles;
-#if NET_2_1
+#if MOBILE
using System.IO.IsolatedStorage;
#endif
return new IOException (message, unchecked((int)0x80070000) | (int)error);
case MonoIOError.ERROR_INVALID_DRIVE:
message = String.Format ("Could not find the drive '{0}'. The drive might not be ready or might not be mapped.", path);
-#if !NET_2_1
+#if !MOBILE
return new DriveNotFoundException (message);
#else
return new IOException (message, unchecked((int)0x80070000) | (int)error);
SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fullpath).Demand ();
}
internal void AddPermissionRequests (PermissionSet required, PermissionSet optional, PermissionSet refused)
{
-#if !NET_2_1
+#if !MOBILE
if (created)
throw new InvalidOperationException ("Assembly was already saved.");
public void AddDeclarativeSecurity (SecurityAction action, PermissionSet pset)
{
-#if !NET_2_1
+#if !MOBILE
if (pset == null)
throw new ArgumentNullException ("pset");
if ((action == SecurityAction.RequestMinimum) ||
public void AddDeclarativeSecurity (SecurityAction action, PermissionSet pset)
{
-#if !NET_2_1
+#if !MOBILE
if (pset == null)
throw new ArgumentNullException ("pset");
if ((action == SecurityAction.RequestMinimum) ||
public void AddDeclarativeSecurity (SecurityAction action, PermissionSet pset)
{
-#if !NET_2_1
+#if !MOBILE
if (pset == null)
throw new ArgumentNullException ("pset");
if ((action == SecurityAction.RequestMinimum) ||
private string GetCodeBase (bool escaped)
{
string cb = get_code_base (escaped);
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
// we cannot divulge local file informations
if (String.Compare ("FILE://", 0, cb, 0, 7, true, CultureInfo.InvariantCulture) == 0) {
return String.Empty;
string loc = get_location ();
-#if !NET_2_1
+#if !MOBILE
if ((loc != String.Empty) && SecurityManager.SecurityEnabled) {
// we cannot divulge local file informations
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, loc).Demand ();
public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence)
{
Assembly a = LoadFrom (assemblyFile, false);
-#if !NET_2_1
+#if !MOBILE
if ((a != null) && (securityEvidence != null)) {
// merge evidence (i.e. replace defaults with provided evidences)
a.Evidence.Merge (securityEvidence);
return other._mono_assembly == _mono_assembly;
}
-#if !NET_2_1
+#if !MOBILE
// Code Access Security
internal void Resolve ()
}
addHandlerType = addHandlerDelegateType.MakeGenericType (typeVector);
-#if NET_2_1
+#if MOBILE
// with Silverlight a coreclr failure (e.g. Transparent caller creating a delegate on a Critical method)
// would normally throw an ArgumentException, so we set throwOnBindFailure to false and check for a null
// delegate that we can transform into a MethodAccessException
o = InternalInvoke (obj, parameters, out exc);
} catch (ThreadAbortException) {
throw;
-#if NET_2_1
+#if MOBILE
} catch (MethodAccessException) {
throw;
#endif
try {
o = InternalInvoke (obj, parameters, out exc);
-#if NET_2_1
+#if MOBILE
} catch (MethodAccessException) {
throw;
#endif
public override
string FullyQualifiedName {
get {
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fqname).Demand ();
}
UnitySerializationHolder.GetUnitySerializationInfo (info, UnitySerializationHolder.ModuleUnity, this.ScopeName, this.GetRuntimeAssembly ());
}
-#if !NET_2_1
+#if !MOBILE
public
override
}
getterType = getterDelegateType.MakeGenericType (typeVector);
-#if NET_2_1
+#if MOBILE
// with Silverlight a coreclr failure (e.g. Transparent caller creating a delegate on a Critical method)
// would normally throw an ArgumentException, so we set throwOnBindFailure to false and check for a null
// delegate that we can transform into a MethodAccessException
_keyPairArray = null;
}
}
-#if !NET_2_1
+#if !MOBILE
else if (_keyPairContainer != null) {
CspParameters csp = new CspParameters ();
csp.KeyContainerName = _keyPairContainer;
{
[ComVisible (true)]
[Serializable]
-#if NET_2_1
+#if MOBILE
public class TargetException : Exception {
#else
public class TargetException : ApplicationException {
{
[ComVisible (true)]
[Serializable]
-#if NET_2_1
+#if MOBILE
public sealed class TargetInvocationException : Exception {
#else
public sealed class TargetInvocationException : ApplicationException {
{
[ComVisible (true)]
[Serializable]
-#if NET_2_1
+#if MOBILE
public sealed class TargetParameterCountException : Exception {
#else
public sealed class TargetParameterCountException : ApplicationException {
string Location { get; }
-#if !NET_2_1
+#if !MOBILE
Evidence Evidence { get; }
#endif
AssemblyName[] GetReferencedAssemblies ();
-#if !NET_2_1
+#if !MOBILE
bool GlobalAssemblyCache { get; }
#endif
if (type.IsContextful)
return RemotingServices.CreateClientProxyForContextBound (type, null);
-#if !NET_2_1
+#if !MOBILE
if (type.IsCOMObject) {
return RemotingServices.CreateClientProxyForComInterop (type);
}
RemotingProxy proxy = new RemotingProxy (type, ChannelServices.CrossContextUrl, activationAttributes);
return proxy.GetTransparentProxy();
}
-#if !NET_2_1
+#if !MOBILE
internal static object CreateClientProxyForComInterop (Type type)
{
Mono.Interop.ComInteropProxy proxy = Mono.Interop.ComInteropProxy.CreateProxy (type);
// and/or Authenticode certs. However this class works with older
// X509v1 certificates and non-authenticode (code signing) certs.
[Serializable]
-#if NET_2_1
+#if MOBILE
public partial class X509Certificate {
#else
public partial class X509Certificate : IDeserializationCallback, ISerializable {
enum X509ContentType {
Unknown,
Cert,
- // not supported by Silverlight 2.0 (NET_2_1)
+ // not supported by Silverlight 2.0 (MOBILE)
SerializedCert,
Pfx,
SerializedStore,
using System.Text;
using System.Threading;
using System.Runtime.InteropServices;
-#if !NET_2_1
+#if !MOBILE
using System.Security.Permissions;
#endif
using MX = Mono.Security.X509;
Interlocked.CompareExchange (ref nativeHelper, helper, null);
}
-#if !NET_2_1
+#if !MOBILE
// typedef struct _CERT_CONTEXT {
// DWORD dwCertEncodingType;
// BYTE *pbCertEncoded;
[ComVisible (true)]
public enum X509KeyStorageFlags {
DefaultKeySet = 0,
- // not supported by Silverlight 2.0 (NET_2_1)
+ // not supported by Silverlight 2.0 (MOBILE)
UserKeySet = 1,
MachineKeySet = 2,
Exportable = 4,
namespace System.Security.Cryptography {
-#if !NET_2_1
+#if !MOBILE
[ComVisible (true)]
#endif
public sealed class RNGCryptoServiceProvider : RandomNumberGenerator {
_handle = RngInitialize (null);
Check ();
}
-#if !NET_2_1
+#if !MOBILE
public RNGCryptoServiceProvider (byte[] rgb)
{
_handle = RngInitialize (rgb);
namespace System.Security.Permissions {
-#if NET_2_1 && !MONOTOUCH
+#if MOBILE && !MONOTOUCH
[Obsolete ("CAS support is not available with Silverlight applications.")]
#endif
[ComVisible (true)]
// Methods
public override IPermission CreatePermission ()
{
-#if NET_2_1
+#if MOBILE
return null;
#else
EnvironmentPermission perm = null;
// Methods
public override IPermission CreatePermission ()
{
-#if NET_2_1
+#if MOBILE
return null;
#else
FileIOPermission perm = null;
public override IPermission CreatePermission ()
{
-#if NET_2_1
+#if MOBILE
return null;
#else
// looks like permission is internal
private PermissionSet CreateFromXml (string xml)
{
-#if !NET_2_1
+#if !MOBILE
SecurityParser sp = new SecurityParser ();
try {
sp.LoadXml (xml);
public PermissionSet CreatePermissionSet ()
{
PermissionSet pset = null;
-#if !NET_2_1
+#if !MOBILE
if (this.Unrestricted)
pset = new PermissionSet (PermissionState.Unrestricted);
else {
// Methods
public override IPermission CreatePermission ()
{
-#if NET_2_1
+#if MOBILE
return null;
#else
ReflectionPermission perm = null;
namespace System.Security.Permissions {
-#if NET_2_1 && !MONOTOUCH
+#if MOBILE && !MONOTOUCH
[Obsolete ("CAS support is not available with Silverlight applications.")]
#endif
[ComVisible (true)]
namespace System.Security.Permissions {
-#if NET_2_1 && !MONOTOUCH
+#if MOBILE && !MONOTOUCH
[Obsolete ("CAS support is not available with Silverlight applications.")]
#endif
[ComVisible (true)]
namespace System.Security.Permissions {
-#if NET_2_1 && !MONOTOUCH
+#if MOBILE && !MONOTOUCH
[Obsolete ("CAS support is not available with Silverlight applications.")]
#endif
[ComVisible (true)]
public override IPermission CreatePermission ()
{
-#if NET_2_1
+#if MOBILE
return null;
#else
SecurityPermission perm = null;
namespace System.Security.Permissions {
-#if NET_2_1 && !MONOTOUCH
+#if MOBILE && !MONOTOUCH
[Obsolete ("CAS support is not available with Silverlight applications.")]
#endif
[ComVisible (true)]
// Methods
public override IPermission CreatePermission ()
{
-#if NET_2_1
+#if MOBILE
return null;
#else
if (this.Unrestricted)
// "possible" presence of an Authenticode signature
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool IsAuthenticodePresent (Assembly a);
-#if NET_2_1
+#if MOBILE
static internal Evidence GetDefaultHostEvidence (Assembly a)
{
return new Evidence ();
return e;
}
-#endif // NET_2_1
+#endif // MOBILE
private class EvidenceEnumerator : IEnumerator {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
namespace System.Security.Policy {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System.Collections;
using System.Diagnostics;
disposed = true;
}
-#if !NET_2_1
+#if !MOBILE
public void SetAccessControl (EventWaitHandleSecurity eventSecurity)
{
if (null == eventSecurity)
}
}
-#if !NET_2_1
+#if !MOBILE
public void SetAccessControl (MutexSecurity mutexSecurity)
{
if (null == mutexSecurity)
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern AppDomainSetup getSetup ();
-#if NET_2_1
+#if MOBILE
internal
#endif
AppDomainSetup SetupInformationNoCopy {
}
}
-#if !NET_2_1
+#if !MOBILE
[MonoTODO]
public ApplicationTrust ApplicationTrust {
get { throw new NotImplementedException (); }
public string BaseDirectory {
get {
string path = SetupInformationNoCopy.ApplicationBase;
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled && (path != null) && (path.Length > 0)) {
// we cannot divulge local file informations
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path).Demand ();
public string RelativeSearchPath {
get {
string path = SetupInformationNoCopy.PrivateBinPath;
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled && (path != null) && (path.Length > 0)) {
// we cannot divulge local file informations
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path).Demand ();
return null;
string path = Path.Combine (setup.DynamicBase, setup.ApplicationName);
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled && (path != null) && (path.Length > 0)) {
// we cannot divulge local file informations
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path).Demand ();
SetupInformationNoCopy.ShadowCopyDirectories = String.Empty;
}
-#if !NET_2_1
+#if !MOBILE
public ObjectHandle CreateComInstanceFrom (string assemblyName, string typeName)
{
return Activator.CreateComInstanceFrom (assemblyName, typeName);
} else if (info.ConfigurationFile == null)
info.ConfigurationFile = "[I don't have a config file]";
-#if !NET_2_1
+#if !MOBILE
if (info.AppDomainInitializer != null) {
if (!info.AppDomainInitializer.Method.IsStatic)
throw new ArgumentException ("Non-static methods cannot be invoked as an appdomain initializer");
else
ad._evidence = new Evidence (securityInfo); // copy
-#if !NET_2_1
+#if !MOBILE
if (info.AppDomainInitializer != null) {
Loader loader = new Loader (
info.AppDomainInitializer.Method.DeclaringType.Assembly.Location);
}
#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
-#if !NET_2_1
+#if !MOBILE
[Serializable]
class Loader {
}
#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
-#if !NET_2_1
+#if !MOBILE
#if MONO_FEATURE_MULTIPLE_APPDOMAINS
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info,
PermissionSet grantSet, params StrongName [] fullTrustAssemblies)
SetData (name, data);
}
-#if !NET_2_1
+#if !MOBILE
[Obsolete ("Use AppDomainSetup.DynamicBase")]
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
public void SetDynamicBase (string path)
{
SetupInformationNoCopy.DynamicBase = path;
}
-#endif // !NET_2_1
+#endif // !MOBILE
[Obsolete ("AppDomain.GetCurrentThreadId has been deprecated"
+ " because it does not provide a stable Id when managed"
private Assembly DoAssemblyResolve (string name, Assembly requestingAssembly, bool refonly)
{
ResolveEventHandler del;
-#if !NET_2_1
+#if !MOBILE
if (refonly)
del = ReflectionOnlyAssemblyResolve;
else
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_1
+#if MOBILE
using System.Runtime.InteropServices;
using System.Security;
[ClassInterface (ClassInterfaceType.None)]
[ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
-#if NET_2_1
+#if MOBILE
public sealed class AppDomainSetup
#else
public sealed class AppDomainSetup : IAppDomainSetup
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System.Text;
using System.Runtime.InteropServices;
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System;
using System.Text;
{
public static partial class Console
{
-#if !NET_2_1
+#if !MOBILE
private class WindowsConsole
{
public static bool ctrlHandlerAdded = false;
//
// On Windows, follow the Windows tradition
//
-#if NET_2_1
+#if MOBILE
// should never happen since Moonlight does not run on windows
inputEncoding = outputEncoding = Encoding.Default;
#else
static void SetupStreams (Encoding inputEncoding, Encoding outputEncoding)
{
-#if !NET_2_1
+#if !MOBILE
if (!Environment.IsRunningOnWindows && ConsoleDriver.IsConsole) {
stdin = new CStreamReader (OpenStandardInput (0), inputEncoding);
stdout = TextWriter.Synchronized (new CStreamWriter (OpenStandardOutput (0), outputEncoding, true) { AutoFlush = true });
stdout.WriteLine (String.Format (format, args));
}
-#if !NET_2_1
+#if !MOBILE
public static int Read ()
{
if ((stdin is CStreamReader) && ConsoleDriver.IsConsole) {
}
}
-#if !NET_2_1
+#if !MOBILE
public static ConsoleColor BackgroundColor {
get { return ConsoleDriver.BackgroundColor; }
set { ConsoleDriver.BackgroundColor = value; }
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System.IO;
using System.Runtime.CompilerServices;
return trace.ToString ();
}
}
-#if !NET_2_1
+#if !MOBILE
/// <summary>
/// Get a fully qualified path to the system directory
/// </summary>
/// </summary>
public static string GetEnvironmentVariable (string variable)
{
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new EnvironmentPermission (EnvironmentPermissionAccess.Read, variable).Demand ();
}
/// <summary>
/// Return a set of all environment variables and their values
/// </summary>
-#if !NET_2_1
+#if !MOBILE
public static IDictionary GetEnvironmentVariables ()
{
StringBuilder sb = null;
else
dir = UnixGetFolderPath (folder, option);
-#if !NET_2_1
+#if !MOBILE
if ((dir != null) && (dir.Length > 0) && SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, dir).Demand ();
}
}
#endif
-#if !NET_2_1
+#if !MOBILE
//
// Used by gacutil.exe
//
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System.Runtime.InteropServices;
using System.Text;
namespace System {
[ComVisible (true)]
public static class Nullable {
-#if NET_2_1
+#if MOBILE
[ComVisible (false)]
#endif
public static int Compare<T> (T? n1, T? n2) where T: struct
return n2.has_value ? -1 : 0;
}
-#if NET_2_1
+#if MOBILE
[ComVisible (false)]
#endif
public static bool Equals<T> (T? n1, T? n2) where T: struct
// https://github.com/dotnet/corefx
// src/System.Console/src/System/ConsolePal.Unix.cs
//
-#if !NET_2_1
+#if !MOBILE
//
// Defining this writes the output to console.log
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
// These values are taken from 'man 5 terminfo' and /usr/include/term.h.
// They are the indexes for the numeric capabilities in a terminfo file.
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System.IO;
using System.Text;
namespace System {
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
// These values are taken from 'man 5 terminfo' and /usr/include/term.h.
// They are the indexes for the string capabilities in a terminfo file.
#endif
private AdjustmentRule [] adjustmentRules;
-#if !NET_2_1 || MOBILE_STATIC
+#if !MOBILE || MOBILE_STATIC
/// <summary>
/// Determine whether windows of not (taken Stephane Delcroix's code)
/// </summary>
//FIXME: this method should check for cached values in systemTimeZones
if (id == null)
throw new ArgumentNullException ("id");
-#if !NET_2_1
+#if !MOBILE
if (TimeZoneKey != null)
{
if (id == "Coordinated Universal Time")
}
#endif
-#if !NET_2_1
+#if !MOBILE
private static TimeZoneInfo FromRegistryKey (string id, RegistryKey key)
{
byte [] reg_tzi = (byte []) key.GetValue ("TZI");
}
//Constructors
-#if NET_2_1
+#if MOBILE
protected WeakReference ()
{
}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_2_1
+#if !MOBILE
using System.Runtime.InteropServices;
using System.Text;
namespace System {
[method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
event UnhandledExceptionEventHandler UnhandledException;
-#if !NET_2_1
+#if !MOBILE
void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
-#if !NET_2_1
+#if !MOBILE
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
// note: mono transforms the CodeBase into uppercase
// for net 1.1 which uses file:// and not file:///
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForDomain ();
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
-#if !NET_2_1
+#if !MOBILE
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
// note: mono transforms the CodeBase into uppercase
// for net 1.1 which uses file:// and not file:///
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication ();
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
-#if !NET_2_1
+#if !MOBILE
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().IndexOf (Assembly.GetExecutingAssembly ().CodeBase) > 0), "Url");
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (IsolatedStorageException))]
public void GetUserStoreForApplication_AssemblyIdentity ()
IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly;
IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, typeof (Zone), typeof (Zone));
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
-#if !NET_2_1
+#if !MOBILE
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
Assert.IsTrue ((isf.AssemblyIdentity is Zone), "AssemblyIdentity");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().IndexOf ("MyComputer") > 0), "Zone - Assembly");
IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, typeof (StrongName), typeof (Url));
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
Assert.AreEqual (scope, isf.Scope, "Scope");
-#if !NET_2_1
+#if !MOBILE
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
// note: mono transforms the CodeBase into uppercase
// for net 1.1 which uses file:// and not file:///
// Maximum size for Internet isn't (by default) Int64.MaxValue
Assert.AreEqual (scope, isf.Scope, "Scope");
-#if !NET_2_1
+#if !MOBILE
Assert.IsTrue ((isf.AssemblyIdentity is Zone), "AssemblyIdentity");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().IndexOf ("Intranet") > 0), "Zone - Assembly");
Assert.IsTrue ((isf.DomainIdentity is Zone), "DomainIdentity");
{
IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Roaming | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain;
IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, null, null);
-#if !NET_2_1
+#if !MOBILE
Assert.AreEqual (typeof (Url), isf.AssemblyIdentity.GetType (), "AssemblyIdentity");
Assert.AreEqual (typeof (Url), isf.DomainIdentity.GetType (), "DomainIdentity");
#endif
[TestFixture]
public class FileStreamWithClosedSafeHandleTests
{
-#if !NET_2_1
+#if !MOBILE
private FileStream GetFileStreamWithClosedHandle ()
{
var fs1 = new FileStream ("test2", FileMode.OpenOrCreate);
Assert.AreEqual ("FOO", ((ObsoleteAttribute) attrs [0]).Message, "#B3");
}
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void TestAddDeclarativeSecurityAlreadyCreated ()
#if !MOBILE
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", inst.FullName, "#3");
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
-#elif NET_2_1 || MOBILE
+#elif MOBILE || MOBILE
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]", inst.FullName, "#3");
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
Assert.AreEqual ("foo.type[System.Double,System.String]", inst.ToString (), "#5");
}
}
-#if !NET_2_1
+#if !MOBILE
public enum ParamEnum {
None = 0,
Foo = 1,
}
}
-#if !NET_2_1
+#if !MOBILE
[Test]
public void TestGetComSlotForMethodInfo ()
{
);
#endif
}
-#if !NET_2_1
+#if !MOBILE
[ComImport()]
[Guid("AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA")]
interface ITestDefault
[Test]
#if MOBILE
- [Ignore ("There's no GAC for the NET_2_1 based profiles (Moonlight, MonoTouch and Mono for Android")]
+ [Ignore ("There's no GAC for the MOBILE based profiles (Moonlight, MonoTouch and Mono for Android")]
#endif
public void FromGlobalAccessCache ()
{
}
[Test]
-#if NET_2_1
- [Ignore ("This constructor always throw a NotSupportedException under NET_2_1 and is useless without CryptoAPI (i.e. outside Windows)")]
+#if MOBILE
+ [Ignore ("This constructor always throw a NotSupportedException under MOBILE and is useless without CryptoAPI (i.e. outside Windows)")]
#endif
public void ConstructorIntPtr ()
{
// additional names (URL) used for XMLDSIG (System.Security.Cryptography.Xml)
// URL taken from http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/
[Test]
-#if NET_2_1
+#if MOBILE
[Ignore ("System.Security.dll is not part of Moonlight, MonoTouch and Mono for Android")]
#endif
public void CreateFromURL ()
}
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (NotSupportedException))]
public void Read_Disposed_Break ()
}
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")]
public void CspKeyContainerInfo_NewKeypair ()
public virtual bool ManagedHashImplementation {
get { return false; }
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // Mono nevers throws an exception (and we're all managed ;-)
public void TransformFinalBlock_Twice ()
{
Assert.AreEqual (HashBuffer (false), HashBuffer (true), "Intersect");
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (NullReferenceException))]
[Category ("NotWorking")] // initialization problem ? fx2.0 only ?
PasswordDeriveBytes pdb = new PasswordDeriveBytes (pwd, salt, new CspParameters ());
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // CspParameters aren't supported by Mono (requires CryptoAPI)
public void Ctor_PasswordSaltNullCspParameters ()
Assert.AreEqual (ssalt, BitConverter.ToString (pdb.Salt), "Salt");
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // CspParameters aren't supported by Mono (requires CryptoAPI)
public void Ctor_PasswordSaltCspParameters ()
PasswordDeriveBytes pdb = new PasswordDeriveBytes (pwd, salt, "SHA1", 1, new CspParameters ());
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // CspParameters aren't supported by Mono (requires CryptoAPI)
public void Ctor_PasswordSaltNullHashIterationCspParameters ()
PasswordDeriveBytes pdb = new PasswordDeriveBytes ("s3kr3t", salt, "SHA1", 0, new CspParameters ());
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // CspParameters aren't supported by Mono (requires CryptoAPI)
public void Ctor_PasswordSaltHashIterationMaxValueCspParameters ()
Assert.AreEqual (ssalt, BitConverter.ToString (pdb.Salt), "Salt");
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // CspParameters aren't supported by Mono (requires CryptoAPI)
public void Ctor_PasswordSaltHashIterationCspParameters ()
pd.CryptDeriveKey ("AlgName", "MD5", -256, new byte [8]);
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")] // bug #79499
public void LongMultipleGetBytes ()
{
_algo = new RNGCryptoServiceProvider ();
}
-#if !NET_2_1
+#if !MOBILE
[Test]
public void ConstructorByteArray ()
{
rsa.VerifyHash (hash, "1.3.14.3.2.26", null);
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")]
public void ImportDisposed ()
Assert.IsNotNull (r.Decrypt (bytes, true));
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[Category ("NotWorking")]
public void CspKeyContainerInfo_NewKeypair ()
CreateEncryptor_IV (size);
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (CryptographicException))]
// Rijndael is the only implementation that has
int size = (aes.BlockSize >> 3);
CreateDecryptor_IV (size);
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (CryptographicException))]
// Rijndael is the only implementation that has
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// NET_2_1 profile lacks some (of the few) CAS features required to execute those tests
-#if !NET_2_1
+// MOBILE profile lacks some (of the few) CAS features required to execute those tests
+#if !MOBILE
using NUnit.Framework;
using System;
Assert.IsFalse (d.IsSynchronized, "IsSynchronized");
}
-#if !NET_2_1
+#if !MOBILE
[Test] // bug #333740
public void GetEnvironmentVariables_NewlySet ()
{
#endif
}
-#if !NET_2_1
+#if !MOBILE
[Test]
[ExpectedException (typeof (ArgumentException))]
public void GetEnvironmentVariable_Target_Invalid ()
using System.Diagnostics;
using Mono.CompilerServices.SymbolWriter;
-#if NET_2_1
+#if MOBILE
using XmlElement = System.Object;
#endif
using System.Text;
using Mono.CompilerServices.SymbolWriter;
-#if NET_2_1
+#if MOBILE
using XmlElement = System.Object;
#else
using System.Xml;
//
//
-#if BOOTSTRAP_WITH_OLDLIB || NET_2_1
+#if BOOTSTRAP_WITH_OLDLIB || MOBILE
using XmlElement = System.Object;
QuitRequested = true;
}
-#if !NET_2_1
+#if !MOBILE
/// <summary>
/// Describes an object or a type.
/// </summary>
using Mono.CompilerServices.SymbolWriter;
using System.Runtime.CompilerServices;
-#if NET_2_1
+#if MOBILE
using XmlElement = System.Object;
#else
using System.Xml;
using System.Text;
using Mono.CompilerServices.SymbolWriter;
-#if NET_2_1
+#if MOBILE
using XmlElement = System.Object;
#endif
default_references.Add ("System");
default_references.Add ("System.Xml");
-#if NET_2_1
+#if MOBILE
default_references.Add ("System.Net");
default_references.Add ("System.Windows");
default_references.Add ("System.Windows.Browser");
}
}
-#if !NET_2_1
+#if !MOBILE
class ProcessTester: ITester
{
ProcessStartInfo pi;
bool update_verif_file;
Hashtable verif_data;
-#if !NET_2_1
+#if !MOBILE
ProcessStartInfo pi;
#endif
readonly string mono;
files_folder = Directory.GetCurrentDirectory ();
this.verif_file = verif_file;
-#if !NET_2_1
+#if !MOBILE
pi = new ProcessStartInfo ();
pi.CreateNoWindow = true;
pi.WindowStyle = ProcessWindowStyle.Hidden;
string filename = test.FileName;
AppDomain domain = null;
-#if !NET_2_1
+#if !MOBILE
if (safe_execution) {
// Create a new AppDomain, with the current directory as the base.
AppDomainSetup setupInfo = new AppDomainSetup ();
try {
DomainTester tester;
try {
-#if !NET_2_1
+#if !MOBILE
if (domain != null)
tester = (DomainTester) domain.CreateInstanceAndUnwrap (typeof (PositiveChecker).Assembly.FullName, typeof (DomainTester).FullName);
else
if (doc_output != null) {
string ref_file = filename.Replace (".cs", "-ref.xml");
try {
-#if !NET_2_1
+#if !MOBILE
new XmlComparer ("doc").Compare (ref_file, doc_output);
#endif
} catch (Exception e) {
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//
+//\r
\r
-#if !NET_2_1\r
+#if !MOBILE\r
\r
using System;\r
using System.Collections;\r
}\r
}\r
\r
-#endif
+#endif\r