Beispiel #1
0
        /// <summary>
        ///   The deserialize.
        /// </summary>
        /// <returns>
        ///   The <see cref="BaseAnswerMessageTemplate" />.
        /// </returns>
        internal BaseAnswerMessageTemplate Deserialize()
        {
            try
            {
                if (FileSystemPhysical.FileExists(filePath))
                {
                    switch (Path.GetExtension(filePath).ToLower())
                    {
                    case ".rsp_zk1":
                        return(XmlStreamer.Deserialize <RSP_ZK1>(filePath));

                    case ".rsp_zk2":
                        return(XmlStreamer.Deserialize <RSP_ZK2>(filePath));

                    case ".rsp_zk4":
                        return(XmlStreamer.Deserialize <RSP_ZK4>(filePath));

                    case ".rsp_zk5":
                        return(XmlStreamer.Deserialize <RSP_ZK5>(filePath));
                    }

                    return(XmlStreamer.Deserialize <Ack>(filePath));
                }
            }
            catch (Exception exception)
            {
                FomsLogger.WriteError(exception, null);
            }

            return(null);
        }
Beispiel #2
0
        /// <summary>
        ///   The load.
        /// </summary>
        /// <returns>
        ///   The <see cref="XElement" />.
        /// </returns>
        internal XElement Load()
        {
            if (FileSystemPhysical.FileExists(filePath))
            {
                return(XElement.Load(filePath));
            }

            return(null);
        }