コード例 #1
0
        private static SvnLogEventArgs Parse(XElement element)
        {
            var obj = new SvnLogEventArgs()
            {
                Author   = element.XPathSelectElement("author").Value,
                Revision = long.Parse(element.Attribute("revision").Value),
                Comment  = element.XPathSelectElement("msg").Value,
                DateTime = XmlConvert.ToDateTime(element.XPathSelectElement("date").Value, XmlDateTimeSerializationMode.Utc)
            };
            var pathItems       = element.XPathSelectElements("paths/path").ToArray();
            var changedItemList = new List <SvnChangeItem>();

            foreach (var item in pathItems)
            {
                var changedItem = SvnChangeItem.Parse(item);
                changedItemList.Add(changedItem);
            }
            obj.ChangedPaths = changedItemList.ToArray();

            var propItems    = element.XPathSelectElements("revprops/property").ToArray();
            var propItemList = new List <SvnPropertyValue>();

            foreach (var item in propItems)
            {
                var propItem = SvnPropertyValue.Parse(item);
                propItemList.Add(propItem);
            }
            obj.Properties = propItemList.ToArray();

            return(obj);
        }
コード例 #2
0
        public static SvnChangeItem Parse(XElement element)
        {
            var obj = new SvnChangeItem()
            {
                Action = element.Attribute("action").Value,
                Path   = element.Value,
            };

            {
                var attr = element.Attribute("copyfrom-path");
                if (attr != null)
                {
                    obj.CopyFromPath = attr.Value;
                }
            }
            {
                var attr = element.Attribute("copyfrom-rev");
                if (attr != null)
                {
                    obj.CopyFromRevision = long.Parse(attr.Value);
                }
            }

            return(obj);
        }