UrlSyndicationContent.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 / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Syndication / UrlSyndicationContent.cs / 1 / UrlSyndicationContent.cs

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

namespace System.ServiceModel.Syndication 
{
    using System.Xml; 
 
    // NOTE: This class implements Clone so if you add any members, please update the copy ctor
    public class UrlSyndicationContent : SyndicationContent 
    {
        string mediaType;
        Uri url;
 
        public UrlSyndicationContent(Uri url, string mediaType) : base()
        { 
            if (url == null) 
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("url"); 
            }
            this.url = url;
            this.mediaType = mediaType;
        } 

        protected UrlSyndicationContent(UrlSyndicationContent source) 
            : base(source) 
        {
            if (source == null) 
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("source");
            }
            this.url = source.url; 
            this.mediaType = source.mediaType;
        } 
 
        public override string Type
        { 
            get { return this.mediaType; }
        }

        public Uri Url 
        {
            get { return this.url; } 
        } 

        public override SyndicationContent Clone() 
        {
            return new UrlSyndicationContent(this);
        }
 
        protected override void WriteContentsTo(XmlWriter writer)
        { 
            writer.WriteAttributeString(Atom10Constants.SourceTag, string.Empty, FeedUtils.GetUriString(this.url)); 
        }
    } 
}

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