PageRenderTime 54ms CodeModel.GetById 46ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Mercurial.Net/XmlSerializationTypes/LogEntryNode.cs

#
C# | 144 lines | 85 code | 14 blank | 45 comment | 0 complexity | ba5115ed8b2dde57a1d7785b8173a679 MD5 | raw file
  1using System;
  2using System.Collections.Generic;
  3using System.Collections.ObjectModel;
  4using System.ComponentModel;
  5using System.Xml.Serialization;
  6
  7namespace Mercurial.XmlSerializationTypes
  8{
  9    /// <summary>
 10    /// This class encapsulates a &lt;logentry...&gt; node in the log output.
 11    /// </summary>
 12    [XmlType("logentry")]
 13    [EditorBrowsable(EditorBrowsableState.Never)]
 14    public class LogEntryNode
 15    {
 16        /// <summary>
 17        /// This is the backing field for the <see cref="Copies"/> property.
 18        /// </summary>
 19        private readonly List<LogEntryCopyNode> _Copies = new List<LogEntryCopyNode>();
 20
 21        /// <summary>
 22        /// This is the backing field for the <see cref="Parents"/> property.
 23        /// </summary>
 24        private readonly List<LogEntryParentNode> _Parents = new List<LogEntryParentNode>();
 25
 26        /// <summary>
 27        /// This is the backing field for the <see cref="PathActions"/> property.
 28        /// </summary>
 29        private readonly List<LogEntryPathNode> _PathActions = new List<LogEntryPathNode>();
 30
 31        /// <summary>
 32        /// This is the backing field for the <see cref="Tags"/> property.
 33        /// </summary>
 34        private readonly List<LogEntryTagNode> _Tags = new List<LogEntryTagNode>();
 35
 36        /// <summary>
 37        /// Gets or sets the local revision number of this log entry.
 38        /// </summary>
 39        [XmlAttribute("revision")]
 40        public int Revision
 41        {
 42            get;
 43            set;
 44        }
 45
 46        /// <summary>
 47        /// Gets or sets the hash of this log entry.
 48        /// </summary>
 49        [XmlAttribute("node")]
 50        public string Hash
 51        {
 52            get;
 53            set;
 54        }
 55
 56        /// <summary>
 57        /// Gets the tags of this log entry.
 58        /// </summary>
 59        [XmlElement("tag")]
 60        public Collection<LogEntryTagNode> Tags
 61        {
 62            get
 63            {
 64                return new Collection<LogEntryTagNode>(_Tags);
 65            }
 66        }
 67
 68        /// <summary>
 69        /// Gets or sets the commit message of this log entry.
 70        /// </summary>
 71        [XmlElement("msg")]
 72        public string CommitMessage
 73        {
 74            get;
 75            set;
 76        }
 77
 78        /// <summary>
 79        /// Gets or sets the timestamp of this log entry.
 80        /// </summary>
 81        [XmlElement("date")]
 82        public DateTime Timestamp
 83        {
 84            get;
 85            set;
 86        }
 87
 88        /// <summary>
 89        /// Gets or sets the author of this log entry.
 90        /// </summary>
 91        [XmlElement("author")]
 92        public LogEntryAuthorNode Author
 93        {
 94            get;
 95            set;
 96        }
 97
 98        /// <summary>
 99        /// Gets the collection of parents of this log entry.
100        /// </summary>
101        [XmlElement("parent")]
102        public Collection<LogEntryParentNode> Parents
103        {
104            get
105            {
106                return new Collection<LogEntryParentNode>(_Parents);
107            }
108        }
109
110        /// <summary>
111        /// Gets or sets the named branch this log entry is on.
112        /// </summary>
113        [XmlElement("branch")]
114        public string Branch
115        {
116            get;
117            set;
118        }
119
120        /// <summary>
121        /// Gets the individual path actions of this log entry.
122        /// </summary>
123        [XmlArray("paths")]
124        public Collection<LogEntryPathNode> PathActions
125        {
126            get
127            {
128                return new Collection<LogEntryPathNode>(_PathActions);
129            }
130        }
131
132        /// <summary>
133        /// Gets the copies, Add actions that are really copies of existing sources.
134        /// </summary>
135        [XmlArray("copies")]
136        public Collection<LogEntryCopyNode> Copies
137        {
138            get
139            {
140                return new Collection<LogEntryCopyNode>(_Copies);
141            }
142        }
143    }
144}