Exemplo n.º 1
0
        private bool DeserializeN42(string filePath)
        {
            XmlSerializer serializer;

            try
            {
                serializer = new XmlSerializer(typeof(RadInstrumentDataType));
                serializer.UnknownElement   += new XmlElementEventHandler(Serializer_UnknownElement);
                serializer.UnknownAttribute += new XmlAttributeEventHandler(Serializer_UnknownAttribute);

                using (TextReader stream = File.OpenText(filePath))
                {
                    radInstrumentDataType = serializer.Deserialize(stream) as RadInstrumentDataType;
                }
            }
            catch (Exception ex)
            {
                fileErrors.Add(new KeyValuePair <string, string>(Path.GetFileNameWithoutExtension(filePath), "Deserializing N42 file failed: " + ex.Message));
                ErrorsOccurred = true;
                return(false);
            }

            if (radInstrumentDataType == null)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 public override void Cleanup()
 {
     deviceDatasParsed     = new List <DeviceData>();
     radInstrumentDataType = null;
 }
Exemplo n.º 3
0
 private void Clear()
 {
     radInstrumentDataType = null;
     deviceData            = null;
 }
Exemplo n.º 4
0
 private void Clear()
 {
     deviceData        = null;
     radInstrumentData = null;
 }