Namespace BallisticCalculator.Serialization

Brief

The classes related to serialization of the library data.

Details

You can serialize and deserialize data classes: Ammunition, Atmosphere, ZeroingParameters, Rifling, Rifle, Wind, ShotParameters, TrajectoryPoint, and ReticleDefinition.

To serialize the object use BallisticXmlSerializer.

Example: How to serialize a reticle definition.

xmlDocument = new XmlDocument();
BallisticXmlSerializer serializer = new BallisticXmlSerializer(xmlDocument);
xmlDocument.AppendChild(serializer.Serialize(reticle));
xmlDocument.Save("mildot.reticle");

To deserialize the object use BallisticXmlDeserializer. Example: How to read and deserialize a reticle definition

xmlDocument = new XmlDocument();
xmlDocument.Load("mildot.reticle");
BallisticXmlDeserializer deserializer = new BallisticXmlDeserializer();
var reticle1 = deserializer.Deserialize<ReticleDefinition>(xmlDocument.DocumentElement);

Classes

BallisticXmlDeserializer

Deserializer of ballistic calculator values

BallisticXmlExtensions

Extension classes to simplify serialization invocation

BallisticXmlSerializer

Serializer

BXmlConstructorAttribute

The attribute to mark up to constructor to be used to deserialization

BXmlElementAttribute

The attribute to markup the ballistic calculator serializable class

BXmlPropertyAttribute

The attribute to markup the ballistic calculator serializable property

BXmlSelectAttribute

The type that may be serialized by multiple option(s)

back