//
// Class: transmitter
// Current CLR: 4.0.30319.34209
// System: Microsoft Visual Studio 10.0
// Author: dani
// Created: 7/14/2015 7:39:29 AM
//
// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using log4net;
namespace bsmd.hisnord
{
public class transmitter
{
private static ILog _log = LogManager.GetLogger(typeof(transmitter));
///
/// class to read transmitter result xml files
///
[Serializable]
public class result
{
public result() { }
public int code { get; set; }
public string message { get; set; }
public string detail { get; set; }
///
/// create result items from file
///
public static result ReadResult(string filename)
{
result aResult = null;
try
{
XmlSerializer serializer = new XmlSerializer(typeof(result));
using (FileStream fs = new FileStream(filename, FileMode.Open))
{
aResult = (result)serializer.Deserialize(fs);
}
}
catch (Exception ex)
{
_log.ErrorFormat("Exception deserializing transmitter result: {0}", ex.Message);
}
return aResult;
}
}
}
}