Ejemplo n.º 1
0
        //      <QueryChangesetResult cmtr="string" cmtrdisp="string" date="dateTime" cset="int" owner="string" ownerdisp="string">
        //        <Comment>string</Comment>
        //        <CheckinNote>
        //          <Values>
        //            <CheckinNoteFieldValue xsi:nil="true" />
        //            <CheckinNoteFieldValue xsi:nil="true" />
        //          </Values>
        //        </CheckinNote>
        //        <PolicyOverride>
        //          <Comment>string</Comment>
        //          <PolicyFailures>
        //            <PolicyFailureInfo xsi:nil="true" />
        //            <PolicyFailureInfo xsi:nil="true" />
        //          </PolicyFailures>
        //        </PolicyOverride>
        //        <Properties>
        //          <PropertyValue pname="string">
        //            <val />
        //          </PropertyValue>
        //          <PropertyValue pname="string">
        //            <val />
        //          </PropertyValue>
        //        </Properties>
        //        <Changes>
        //          <Change type="None or Add or Edit or Encoding or Rename or Delete or Undelete or Branch or Merge or Lock or Rollback or SourceRename or Property" typeEx="int">
        //            <Item xsi:nil="true" />
        //            <MergeSources xsi:nil="true" />
        //          </Change>
        //          <Change type="None or Add or Edit or Encoding or Rename or Delete or Undelete or Branch or Merge or Lock or Rollback or SourceRename or Property" typeEx="int">
        //            <Item xsi:nil="true" />
        //            <MergeSources xsi:nil="true" />
        //          </Change>
        //        </Changes>
        //      </QueryChangesetResult>
        internal static Changeset FromXml(XElement element)
        {
            Changeset changeset = new Changeset();
            changeset.Committer = element.Attribute("cmtr").Value;
            changeset.ChangesetId = GeneralHelper.XmlAttributeToInt(element.Attribute("cset").Value);
            string date = element.Attribute("date").Value;
            changeset.CreationDate = DateTime.ParseExact(date, DateTimeFormats, null, DateTimeStyles.None);
            changeset.Owner = element.Attribute("owner").Value;

            changeset.Comment = element.Element(element.Name.Namespace + "Comment").Value;

            changeset.Changes = element.Element(element.Name.Namespace + "Changes")
                .Elements(element.Name.Namespace + "Change")
                .Select(Change.FromXml).ToArray();
            return changeset;
        }
Ejemplo n.º 2
0
        //      <QueryChangesetResult cmtr="string" cmtrdisp="string" date="dateTime" cset="int" owner="string" ownerdisp="string">
        //        <Comment>string</Comment>
        //        <CheckinNote>
        //          <Values>
        //            <CheckinNoteFieldValue xsi:nil="true" />
        //            <CheckinNoteFieldValue xsi:nil="true" />
        //          </Values>
        //        </CheckinNote>
        //        <PolicyOverride>
        //          <Comment>string</Comment>
        //          <PolicyFailures>
        //            <PolicyFailureInfo xsi:nil="true" />
        //            <PolicyFailureInfo xsi:nil="true" />
        //          </PolicyFailures>
        //        </PolicyOverride>
        //        <Properties>
        //          <PropertyValue pname="string">
        //            <val />
        //          </PropertyValue>
        //          <PropertyValue pname="string">
        //            <val />
        //          </PropertyValue>
        //        </Properties>
        //        <Changes>
        //          <Change type="None or Add or Edit or Encoding or Rename or Delete or Undelete or Branch or Merge or Lock or Rollback or SourceRename or Property" typeEx="int">
        //            <Item xsi:nil="true" />
        //            <MergeSources xsi:nil="true" />
        //          </Change>
        //          <Change type="None or Add or Edit or Encoding or Rename or Delete or Undelete or Branch or Merge or Lock or Rollback or SourceRename or Property" typeEx="int">
        //            <Item xsi:nil="true" />
        //            <MergeSources xsi:nil="true" />
        //          </Change>
        //        </Changes>
        //      </QueryChangesetResult>
        internal static Changeset FromXml(XElement element)
        {
            Changeset changeset = new Changeset();

            changeset.Committer   = element.Attribute("cmtr").Value;
            changeset.ChangesetId = GeneralHelper.XmlAttributeToInt(element.Attribute("cset").Value);
            string date = element.Attribute("date").Value;

            changeset.CreationDate = DateTime.ParseExact(date, DateTimeFormats, null, DateTimeStyles.None);
            changeset.Owner        = element.Attribute("owner").Value;

            changeset.Comment = element.Element(element.Name.Namespace + "Comment").Value;

            changeset.Changes = element.Element(element.Name.Namespace + "Changes")
                                .Elements(element.Name.Namespace + "Change")
                                .Select(Change.FromXml).ToArray();
            return(changeset);
        }