6 |
using System.IO; |
using System.IO; |
7 |
using Enterprise.Logging; |
using Enterprise.Logging; |
8 |
using System.Xml.Linq; |
using System.Xml.Linq; |
9 |
|
using System.Xml; |
10 |
|
|
11 |
namespace libxmltv.Core |
namespace libxmltv.Core |
12 |
{ |
{ |
40 |
//xmltv_logger.Log.Warn.WriteLine("XML File Loading has not been implemented yet!"); |
//xmltv_logger.Log.Warn.WriteLine("XML File Loading has not been implemented yet!"); |
41 |
try |
try |
42 |
{ |
{ |
43 |
instance.XmlDoc = XDocument.Load(instance.XmlFile.FullName); |
var document = XDocument.Load(instance.XmlFile.FullName); |
44 |
|
using (var ms = new MemoryStream()) |
45 |
|
using (var xw = new XmlTextWriter(ms, Encoding.UTF8)) |
46 |
|
{ |
47 |
|
document.Save(xw); |
48 |
|
xw.Flush(); |
49 |
|
StreamReader sr = new StreamReader(ms); |
50 |
|
ms.Seek(0, SeekOrigin.Begin); |
51 |
|
instance.XmlDoc = sr.ReadToEnd(); |
52 |
|
} |
53 |
|
document = null; |
54 |
} |
} |
55 |
catch (Exception ex) |
catch (Exception ex) |
56 |
{ |
{ |
63 |
{ |
{ |
64 |
//throw new NotImplementedException(); |
//throw new NotImplementedException(); |
65 |
} |
} |
66 |
|
|
67 |
|
|
68 |
} |
} |
69 |
} |
} |