Esempio n. 1
0
        /// <summary>
        /// The save tt item soap config.
        /// </summary>
        /// <param name="ConfigFile">
        /// The config file.
        /// </param>
        public void SaveTTItemSoapConfig(string ConfigFile)
        {
            var defect = new SerializableCDefect(this.defect);

            using (Stream stream = File.Open(ConfigFile, FileMode.Create))
            {
                IFormatter formatter = new SoapFormatter();
                formatter.Serialize(stream, defect);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// The read tt item soap config.
        /// </summary>
        /// <param name="ConfigFile">
        /// The config file.
        /// </param>
        /// <returns>
        /// The <see cref="CDefect"/>.
        /// </returns>
        public static CDefect ReadTTItemSoapConfig(string ConfigFile)
        {
            SerializableCDefect defect = null;

            using (Stream stream = File.Open(ConfigFile, FileMode.Open, FileAccess.Read))
            {
                IFormatter formatter = new SoapFormatter();
                defect = (SerializableCDefect)formatter.Deserialize(stream);
            }

            return(defect != null?defect.ToCDefect() : null);
        }