2 using System.Collections.Generic;
7 using System.Xml.Serialization;
24 get {
return _BitmapFilePattern; }
25 set { _BitmapFilePattern = value; }
32 get {
return _Shapes; }
33 set { _Shapes = value; }
46 using (MemoryStream ms =
new MemoryStream())
50 using (StreamReader sr =
new StreamReader(ms, Encoding.Default))
67 GetShapeDefinitionsXml().WriteToFile(FileName);
81 Xml = General.FileReader.ReadFileToString(FileName);
85 Log.
Exception(
"Could not load ShapeDefinitions from {0}.".Build(FileName), E);
86 throw new Exception(
"Could not read ShapeDefinitions file {0}.".Build(FileName), E);
89 return GetShapeDefinitionsFromShapeDefinitionsXml(Xml);
103 C = GetShapeDefinitionsFromShapeDefinitionsXmlFile(FileName);
120 return GetShapeDefinitionsFromShapeDefinitionsXmlFile(ShapeDefinitionsShapeDefinitionsFile.FullName);
130 byte[] xmlBytes = Encoding.Default.GetBytes(ShapeDefinitionsXml);
131 using (MemoryStream ms =
new MemoryStream(xmlBytes))
140 Exception Ex =
new Exception(
"Could not deserialize the ShapeDefinitions from XML data.", E);
141 Ex.Data.Add(
"XML Data", ShapeDefinitionsXml);
142 Log.
Exception(
"Could not load ShapeDefinitions from XML data.", Ex);
static ShapeDefinitions GetShapeDefinitionsFromShapeDefinitionsXmlFile(FileInfo ShapeDefinitionsShapeDefinitionsFile)
Instanciates a ShapeDefinitions object from a ShapeDefinitions ShapeDefinitionsuration in a XML file...
A simple logger used to record important events and exceptions.
static ShapeDefinitions GetShapeDefinitionsFromShapeDefinitionsXmlFile(string FileName)
Instanciates a ShapeDefinitions object from a ShapeDefinitions ShapeDefinitionsuration in a XML file...
void SaveShapeDefinitionsXmlFile(string FileName)
Serializes the ShapeDefinitions ShapeDefinitionsuration to a XML file.
static bool TestShapeDefinitionsShapeDefinitionsXmlFile(string FileName)
Tests a ShapeDefinitions ShapeDefinitions in a XML file.
string GetShapeDefinitionsXml()
Returns a serialized XML representation of the ShapeDefinitions ShapeDefinitionsuration.
The namespace DirectOutput.General contains classes for general use.
A file pattern class used to lookup files matching a specified pattern.
static void Exception(string Message, Exception E=null)
Writes a exception message to the log.
static ShapeDefinitions GetShapeDefinitionsFromShapeDefinitionsXml(string ShapeDefinitionsXml)
Instanciates a ShapeDefinitions object from a ShapeDefinitions ShapeDefinitionsuration in a XML strin...