- VAL.src.zip
- VAL
- Database
- packages
- EntityFramework.4.2.0.0
- lib
- net40
- EntityFramework.dll
- log4net.1.2.10
- lib
- 1.0
- log4net.dll
- 1.1
- log4net.dll
- 2.0
- log4net.dll
- log4net.1.2.11
- lib
- net10-full
- log4net.dll
- net11-full
- log4net.dll
- net20-cf
- log4net.dll
- net20-full
- log4net.dll
- net35-client
- log4net.dll
- net35-full
- log4net.dll
- net40-client
- log4net.dll
- net40-full
- log4net.dll
- Moq.4.0.10827
- lib
- NET35
- Moq.dll
- NET40
- Moq.dll
- Silverlight4
- Castle.Core.dll
- Moq.Silverlight.dll
- License.txt
- Moq.chm
- repositories.config
- structuremap.2.6.3
- lib
- StructureMap.dll
- READ-ME-First!.txt
- VAL.BusinessService
- VAL.ClientService
- VAL.Common
- VAL.Contracts
- VAL.Controls
- VAL.Data
- VAL.GUI
- VAL.Model
- VAL.Service
- VAL.sln
- VAL.Tests
- VAL.User.Documentation
- VAL.zip
- VisualApplicationLauncher
- Database
- Local.testsettings
- NRepo
- ProjectReferences
- EFCachingProvider.dll
- EFCachingProvider.Web.dll
- EFProviderWrapperToolkit.dll
- EFTracingProvider.dll
- log4net.dll
- StructureMap.dll
- READ-ME-First!.txt
- TraceAndTestImpact.testsettings
- VAL.BusinessService
- VAL.Common
- VAL.Contracts
- VAL.Controls
- VAL.Data
- VAL.GUI
- VAL.Model
- VAL.Service
- VAL.sln
- VAL.Tests
- VAL.User.Documentation
- VAL.vsmdi
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.Xml;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
namespace VAL.Contracts.ServiceBehaviour
{
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method)]
public class CyclicReferencesAwareAttribute : Attribute, IContractBehavior, IOperationBehavior
{
private readonly bool _on = true;
public CyclicReferencesAwareAttribute(bool on)
{
_on = on;
}
public bool On
{
get { return (_on); }
}
#region IOperationBehavior Members
void IOperationBehavior.AddBindingParameters(OperationDescription operationDescription, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{
}
void IOperationBehavior.ApplyClientBehavior(OperationDescription operationDescription, System.ServiceModel.Dispatcher.ClientOperation clientOperation)
{
CyclicReferencesAwareContractBehavior.ReplaceDataContractSerializerOperationBehavior(operationDescription, On);
}
void IOperationBehavior.ApplyDispatchBehavior(OperationDescription operationDescription, System.ServiceModel.Dispatcher.DispatchOperation dispatchOperation)
{
CyclicReferencesAwareContractBehavior.ReplaceDataContractSerializerOperationBehavior(operationDescription, On);
}
void IOperationBehavior.Validate(OperationDescription operationDescription)
{
}
#endregion
#region IContractBehavior Members
void IContractBehavior.AddBindingParameters(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{
}
void IContractBehavior.ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
{
CyclicReferencesAwareContractBehavior.ReplaceDataContractSerializerOperationBehaviors(contractDescription, On);
}
void IContractBehavior.ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
{
CyclicReferencesAwareContractBehavior.ReplaceDataContractSerializerOperationBehaviors(contractDescription, On);
}
void IContractBehavior.Validate(ContractDescription contractDescription, ServiceEndpoint endpoint)
{
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.