forked from PWagner1/Windows-API-CodePack-NET-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXyzFileDefinition.cs
More file actions
42 lines (36 loc) · 1.26 KB
/
XyzFileDefinition.cs
File metadata and controls
42 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Linq;
namespace HandlerSamples
{
public class XyzFileDefinition
{
public XyzFileDefinition(Stream stream)
{
XDocument document = XDocument.Load(stream);
Properties = new XyzFileProperties(document.Root.Element("XyzFileProperties"));
EncodedImage = document.Root.Element("EncodedImage").Value;
Content = document.Root.Element("Content").Value;
}
public XyzFileProperties Properties { get; private set; }
public string EncodedImage { get; private set; }
public string Content { get; private set; }
}
public class XyzFileProperties
{
public XyzFileProperties(XElement properties)
{
Author = properties.Element("Author").Value;
Name = properties.Element("Name").Value;
Rating = int.Parse(properties.Element("Rating").Value);
Region = properties.Element("Region").Value;
}
public string Name { get; private set; }
public string Author { get; private set; }
public int Rating { get; private set; }
public string Region { get; private set; }
}
}