internal static PendingChange FromXml(XElement element)
 {
     PendingChange change = new PendingChange();
     change.ServerItem = element.GetAttribute("item");
     change.LocalItem = TfsPath.ToPlatformPath(element.GetAttribute("local"));
     change.ItemId = GeneralHelper.XmlAttributeToInt(element.GetAttribute("itemid"));
     change.Encoding = GeneralHelper.XmlAttributeToInt(element.GetAttribute("enc"));
     change.Version = GeneralHelper.XmlAttributeToInt(element.GetAttribute("ver"));
     change.CreationDate = DateTime.Parse(element.GetAttribute("date"));
     change.Hash = GeneralHelper.ToByteArray(element.GetAttribute("hash"));
     change.uploadHashValue = GeneralHelper.ToByteArray(element.GetAttribute("uhash"));
     change.ItemType = EnumHelper.ParseItemType(element.GetAttribute("type"));
     change.DownloadUrl = element.GetAttribute("durl");
     change.ChangeType = EnumHelper.ParseChangeType(element.GetAttribute("chg"));
     if (change.ChangeType == ChangeType.Edit)
         change.ItemType = ItemType.File;
     return change;
 }
Esempio n. 2
0
        internal static PendingChange FromXml(XElement element)
        {
            PendingChange change = new PendingChange();

            change.ServerItem      = element.GetAttribute("item");
            change.LocalItem       = TfsPath.ToPlatformPath(element.GetAttribute("local"));
            change.ItemId          = GeneralHelper.XmlAttributeToInt(element.GetAttribute("itemid"));
            change.Encoding        = GeneralHelper.XmlAttributeToInt(element.GetAttribute("enc"));
            change.Version         = GeneralHelper.XmlAttributeToInt(element.GetAttribute("ver"));
            change.CreationDate    = DateTime.Parse(element.GetAttribute("date"));
            change.Hash            = GeneralHelper.ToByteArray(element.GetAttribute("hash"));
            change.uploadHashValue = GeneralHelper.ToByteArray(element.GetAttribute("uhash"));
            change.ItemType        = EnumHelper.ParseItemType(element.GetAttribute("type"));
            change.DownloadUrl     = element.GetAttribute("durl");
            change.ChangeType      = EnumHelper.ParseChangeType(element.GetAttribute("chg"));
            if (change.ChangeType == ChangeType.Edit)
            {
                change.ItemType = ItemType.File;
            }
            return(change);
        }