mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
82 lines
3.7 KiB
C#
82 lines
3.7 KiB
C#
//-----------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//-----------------------------------------------------------------------------
|
|
namespace System.ServiceModel.Description
|
|
{
|
|
using System;
|
|
using System.ServiceModel.Channels;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.ServiceModel;
|
|
using System.Runtime.Serialization;
|
|
using System.Xml;
|
|
using System.Xml.Schema;
|
|
using System.CodeDom;
|
|
using WsdlNS = System.Web.Services.Description;
|
|
using System.Xml.Serialization;
|
|
|
|
public class DataContractSerializerMessageContractImporter : IWsdlImportExtension
|
|
{
|
|
bool enabled = true;
|
|
internal const string GenericMessageSchemaTypeName = "MessageBody";
|
|
internal const string GenericMessageSchemaTypeNamespace = "http://schemas.microsoft.com/Message";
|
|
const string StreamBodySchemaTypeName = "StreamBody";
|
|
const string StreamBodySchemaTypeNamespace = GenericMessageSchemaTypeNamespace;
|
|
|
|
static internal XmlQualifiedName GenericMessageTypeName = new XmlQualifiedName(GenericMessageSchemaTypeName, GenericMessageSchemaTypeNamespace);
|
|
static internal XmlQualifiedName StreamBodyTypeName = new XmlQualifiedName(StreamBodySchemaTypeName, StreamBodySchemaTypeNamespace);
|
|
|
|
void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext)
|
|
{
|
|
if (endpointContext == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("endpointContext"));
|
|
|
|
if (enabled)
|
|
MessageContractImporter.ImportMessageBinding(importer, endpointContext, typeof(MessageContractImporter.DataContractSerializerSchemaImporter));
|
|
}
|
|
|
|
void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext contractContext)
|
|
{
|
|
if (contractContext == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("contractContext"));
|
|
|
|
if (enabled)
|
|
MessageContractImporter.ImportMessageContract(importer, contractContext, MessageContractImporter.DataContractSerializerSchemaImporter.Get(importer));
|
|
}
|
|
|
|
void IWsdlImportExtension.BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollection<XmlElement> policy) { }
|
|
|
|
public bool Enabled
|
|
{
|
|
get { return this.enabled; }
|
|
set { this.enabled = value; }
|
|
|
|
}
|
|
}
|
|
|
|
public class XmlSerializerMessageContractImporter : IWsdlImportExtension
|
|
{
|
|
|
|
void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext)
|
|
{
|
|
if (endpointContext == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("endpointContext"));
|
|
|
|
MessageContractImporter.ImportMessageBinding(importer, endpointContext, typeof(MessageContractImporter.XmlSerializerSchemaImporter));
|
|
}
|
|
|
|
void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext contractContext)
|
|
{
|
|
if (contractContext == null)
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("contractContext"));
|
|
|
|
MessageContractImporter.ImportMessageContract(importer, contractContext, MessageContractImporter.XmlSerializerSchemaImporter.Get(importer));
|
|
}
|
|
|
|
void IWsdlImportExtension.BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollection<XmlElement> policy) { }
|
|
|
|
}
|
|
|
|
}
|