RegisterResponseInfo.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 / PeerResolvers / RegisterResponseInfo.cs / 1 / RegisterResponseInfo.cs

                            //------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel.PeerResolvers
{ 
    using System.ServiceModel.Channels;
    using System.ServiceModel; 
    using System.Runtime.Serialization; 

    [MessageContract(IsWrapped = false)] 
    public class RegisterResponseInfo
    {
        [DataContract(Name = "RegisterResponse", Namespace = PeerStrings.Namespace)]
        class RegisterResponseInfoDC 
        {
            [DataMember(Name = "RegistrationLifetime")] 
            public TimeSpan RegistrationLifetime; 

            [DataMember(Name = "RegistrationId")] 
            public Guid RegistrationId;

            public RegisterResponseInfoDC(){}
            public RegisterResponseInfoDC(Guid registrationId, TimeSpan registrationLifetime) 
            {
                this.RegistrationLifetime = registrationLifetime; 
                this.RegistrationId = registrationId; 
            }
        } 

        public RegisterResponseInfo(Guid registrationId, TimeSpan registrationLifetime)
        {
            body = new RegisterResponseInfoDC(registrationId, registrationLifetime); 
        }
 
        public RegisterResponseInfo() 
        {
            body = new RegisterResponseInfoDC(); 
        }

        public Guid RegistrationId
        { 
            get { return this.body.RegistrationId; }
            set { this.body.RegistrationId = value; } 
        } 

        public TimeSpan RegistrationLifetime 
        {
            get { return this.body.RegistrationLifetime; }
            set
            { 
                if (value < TimeSpan.Zero)
                { 
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value, 
                        SR.GetString(SR.SFxTimeoutOutOfRange0)));
                } 

                if (TimeoutHelper.IsTooLarge(value))
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value, 
                        SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
                } 
 
                this.body.RegistrationLifetime = value;
            } 
        }

        [MessageBodyMember(Name = "Update", Namespace = PeerStrings.Namespace)]
        RegisterResponseInfoDC body; 

        public bool HasBody() 
        { 
            return body != null;
        } 
    }
}


// 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