GoogleSitemap.cs :  » Bloggers » dasBlog » newtelligence » DasBlog » Web » Services » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Bloggers » dasBlog 
dasBlog » newtelligence » DasBlog » Web » Services » GoogleSitemap.cs
using System;
using System.Xml.Serialization;

namespace newtelligence.DasBlog.Web.Services{
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.google.com/schemas/sitemap/0.84")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.google.com/schemas/sitemap/0.84", IsNullable = false)]
    public class urlset
    {

        public urlset() { }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("url")]
        public urlCollection url;
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.google.com/schemas/sitemap/0.84")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.google.com/schemas/sitemap/0.84", IsNullable = false)]
    public class url
    {
        public url() { }

        public url(string locIn, DateTime lastmodIn, changefreq freqIn, Decimal priorityIn)
        {
            loc = locIn;
            lastmod = lastmodIn;
            changefreq = freqIn;
            changefreqSpecified = true;
            priority = priorityIn;
            prioritySpecified = true;
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(DataType = "anyURI")]
        public string loc;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("lastmod")]
        public string lastmodString
        {
            get
            {
                return lastmod.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            }
            set
            {
                lastmod = DateTime.ParseExact(value, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            }
        }

        [XmlIgnore]
        public DateTime lastmod;

        /// <remarks/>
        public changefreq changefreq;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool changefreqSpecified;

        /// <remarks/>
        public System.Decimal priority;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool prioritySpecified;
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.google.com/schemas/sitemap/0.84")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.google.com/schemas/sitemap/0.84", IsNullable = false)]
    public enum changefreq
    {

        /// <remarks/>
        always,

        /// <remarks/>
        hourly,

        /// <remarks/>
        daily,

        /// <remarks/>
        weekly,

        /// <remarks/>
        monthly,

        /// <remarks/>
        yearly,

        /// <remarks/>
        never,
    }

    /// <summary>
    /// A collection of elements of type url
    /// </summary>
    public class urlCollection : System.Collections.CollectionBase
    {
        /// <summary>
        /// Initializes a new empty instance of the urlCollection class.
        /// </summary>
        public urlCollection()
        {
            // empty
        }

        /// <summary>
        /// Initializes a new instance of the urlCollection class, containing elements
        /// copied from an array.
        /// </summary>
        /// <param name="items">
        /// The array whose elements are to be added to the new urlCollection.
        /// </param>
        public urlCollection(url[] items)
        {
            this.AddRange(items);
        }

        /// <summary>
        /// Initializes a new instance of the urlCollection class, containing elements
        /// copied from another instance of urlCollection
        /// </summary>
        /// <param name="items">
        /// The urlCollection whose elements are to be added to the new urlCollection.
        /// </param>
        public urlCollection(urlCollection items)
        {
            this.AddRange(items);
        }

        /// <summary>
        /// Adds the elements of an array to the end of this urlCollection.
        /// </summary>
        /// <param name="items">
        /// The array whose elements are to be added to the end of this urlCollection.
        /// </param>
        public virtual void AddRange(url[] items)
        {
            foreach (url item in items)
            {
                this.List.Add(item);
            }
        }

        /// <summary>
        /// Adds the elements of another urlCollection to the end of this urlCollection.
        /// </summary>
        /// <param name="items">
        /// The urlCollection whose elements are to be added to the end of this urlCollection.
        /// </param>
        public virtual void AddRange(urlCollection items)
        {
            foreach (url item in items)
            {
                this.List.Add(item);
            }
        }

        /// <summary>
        /// Adds an instance of type url to the end of this urlCollection.
        /// </summary>
        /// <param name="value">
        /// The url to be added to the end of this urlCollection.
        /// </param>
        public virtual void Add(url value)
        {
            this.List.Add(value);
        }

        /// <summary>
        /// Determines whether a specfic url value is in this urlCollection.
        /// </summary>
        /// <param name="value">
        /// The url value to locate in this urlCollection.
        /// </param>
        /// <returns>
        /// true if value is found in this urlCollection;
        /// false otherwise.
        /// </returns>
        public virtual bool Contains(url value)
        {
            return this.List.Contains(value);
        }

        /// <summary>
        /// Return the zero-based index of the first occurrence of a specific value
        /// in this urlCollection
        /// </summary>
        /// <param name="value">
        /// The url value to locate in the urlCollection.
        /// </param>
        /// <returns>
        /// The zero-based index of the first occurrence of the _ELEMENT value if found;
        /// -1 otherwise.
        /// </returns>
        public virtual int IndexOf(url value)
        {
            return this.List.IndexOf(value);
        }

        /// <summary>
        /// Inserts an element into the urlCollection at the specified index
        /// </summary>
        /// <param name="index">
        /// The index at which the url is to be inserted.
        /// </param>
        /// <param name="value">
        /// The url to insert.
        /// </param>
        public virtual void Insert(int index, url value)
        {
            this.List.Insert(index, value);
        }

        /// <summary>
        /// Gets or sets the url at the given index in this urlCollection.
        /// </summary>
        public virtual url this[int index]
        {
            get
            {
                return (url)this.List[index];
            }
            set
            {
                this.List[index] = value;
            }
        }

        /// <summary>
        /// Removes the first occurrence of a specific url from this urlCollection.
        /// </summary>
        /// <param name="value">
        /// The url value to remove from this urlCollection.
        /// </param>
        public virtual void Remove(url value)
        {
            this.List.Remove(value);
        }

        /// <summary>
        /// Type-specific enumeration class, used by urlCollection.GetEnumerator.
        /// </summary>
        public class Enumerator : System.Collections.IEnumerator
        {
            private System.Collections.IEnumerator wrapped;

            public Enumerator(urlCollection collection)
            {
                this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
            }

            public url Current
            {
                get
                {
                    return (url)(this.wrapped.Current);
                }
            }

            object System.Collections.IEnumerator.Current
            {
                get
                {
                    return (url)(this.wrapped.Current);
                }
            }

            public bool MoveNext()
            {
                return this.wrapped.MoveNext();
            }

            public void Reset()
            {
                this.wrapped.Reset();
            }
        }

        /// <summary>
        /// Returns an enumerator that can iterate through the elements of this urlCollection.
        /// </summary>
        /// <returns>
        /// An object that implements System.Collections.IEnumerator.
        /// </returns>        
        public new virtual urlCollection.Enumerator GetEnumerator()
        {
            return new urlCollection.Enumerator(this);
        }
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.