Example #1
0
 private string SaveDuplicatedCbrToFile(Cbr cbr, string outputPath)
 {
     //XNamespace ms = "http://schemas.ms.it.oem/digitaldistribution/2010/10";
     //XElement doc = new XElement(ms + "ComputerBuildReportAckResponse",
     //    new XElement(ms + "ComputerBuildReportAcks",
     //        from cbr in cbrs
     //        select new XElement(ms + "ComputerBuildReportAck",
     //            new XElement(ms + "MSReportUniqueID", cbr.CbrUniqueId),
     //            new XElement(ms + "CustomerReportUniqueID", cbr.CbrUniqueId),
     //            new XElement(ms + "MSReceivedDateUTC", cbr.MsReceivedDateUtc),
     //            new XElement(ms + "SoldToCustomerID", cbr.SoldToCustomerId),
     //            new XElement(ms + "ReceivedFromCustomerID", cbr.ReceivedFromCustomerId),
     //            new XElement(ms + "CBRAckFileTotal", cbr.CbrAckFileTotal),
     //            new XElement(ms + "CBRAckFileNumber", cbr.CbrAckFileNumber),
     //            new XElement(ms + "FailedValidations",
     //                from failedKey in cbr.CbrKeys.Where(k => k.ReasonCode == Constants.CBRAckReasonCode.DuplicateProductKeyId)
     //                select new XElement(ms + "FailedValidationResult",
     //                    new XElement(ms + "ProductKeyID", failedKey.KeyId),
     //                    new XElement(ms + "HardwareHash", failedKey.HardwareHash),
     //                    new XElement(ms + "ReasonCode", failedKey.ReasonCode),
     //                    new XElement(ms + "ReasonCodeDescription", failedKey.ReasonCodeDescription))))));
     //doc.Save(outputPath);
     Serializer.WriteToXml(cbr.ToBindingReport(), outputPath);
     string fileName = Path.GetFileName(outputPath);
     XmlDocument xDoc = new XmlDocument();
     xDoc.Load(outputPath);
     return xDoc.DocumentElement.OuterXml;
 }
Example #2
0
 private string SaveCbrToFile(Cbr cbr, string outputPath)
 {
     Serializer.WriteToXml(cbr.ToBindingReport(), outputPath);
     string fileName = Path.GetFileName(outputPath);
     XmlDocument xDoc = new XmlDocument();
     xDoc.Load(outputPath);
     return xDoc.DocumentElement.OuterXml;
 }