DataContractSerializerElement.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / DataContractSerializerElement.cs / 1 / DataContractSerializerElement.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Configuration 
{
    using System.ComponentModel; 
    using System.Configuration; 
    using System.Globalization;
    using System.Net.Security; 
    using System.ServiceModel.Security;
    using System.ServiceModel.Dispatcher;
    using System.ServiceModel.Description;
 
    public sealed partial class DataContractSerializerElement : BehaviorExtensionElement
    { 
        public DataContractSerializerElement() 
        {
        } 

        [ConfigurationProperty(ConfigurationStrings.IgnoreExtensionDataObject, DefaultValue = DataContractSerializerDefaults.IgnoreExtensionDataObject)]
        public bool IgnoreExtensionDataObject
        { 
            get {return (bool) base[ConfigurationStrings.IgnoreExtensionDataObject]; }
            set {base[ConfigurationStrings.IgnoreExtensionDataObject] = value; } 
        } 

        [ConfigurationProperty(ConfigurationStrings.MaxItemsInObjectGraph, DefaultValue = DataContractSerializerDefaults.MaxItemsInObjectGraph)] 
        [IntegerValidator(MinValue = 0)]
        public int MaxItemsInObjectGraph
        {
            get { return (int)base[ConfigurationStrings.MaxItemsInObjectGraph]; } 
            set { base[ConfigurationStrings.MaxItemsInObjectGraph] = value; }
        } 
 
        public override void CopyFrom(ServiceModelExtensionElement from)
        { 
            base.CopyFrom(from);

            DataContractSerializerElement source = (DataContractSerializerElement)from;
#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null 
            this.IgnoreExtensionDataObject = source.IgnoreExtensionDataObject;
            this.MaxItemsInObjectGraph = source.MaxItemsInObjectGraph; 
        } 

        protected internal override object CreateBehavior() 
        {
            return new DataContractSerializerServiceBehavior(this.IgnoreExtensionDataObject, this.MaxItemsInObjectGraph);
        }
 
        public override Type BehaviorType
        { 
            get { return typeof(DataContractSerializerServiceBehavior); } 
        }
    } 
}


 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK