summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop/HandBrakeInterop.Test/EncodeJobsPersist.cs
blob: 37ca233c44e9d0a6e6111aa07b2801f088283ecc (plain)
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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Serialization;
using HandBrake.Interop;
using HandBrake.Interop.Model;

namespace HandBrakeInterop.Test
{
	public static class EncodeJobsPersist
	{
		private static XmlSerializer xmlSerializer = new XmlSerializer(typeof(EncodeJob));

		public static EncodeJob GetJob(string jobName)
		{
			XDocument doc = XDocument.Load(jobName + ".xml");
			using (XmlReader reader = doc.CreateReader())
			{
				var job = xmlSerializer.Deserialize(reader) as EncodeJob;



				return job;
			}
		}
	}
}