Beispiel #1
0
        /// <summary>
        /// Các Hàm sử dụng trong Form
        /// </summary>
        /// <returns></returns>

        #region Function
        public static HisLisProperties GetServiceConfig()
        {
            try
            {
                var    myProperties = new HisLisProperties();
                string filePath     = string.Format("{0}{1}.xml", AppPath, myProperties.GetType().Name);
                var    myFileStream = new FileStream(filePath, FileMode.Open);
                var    mySerializer = new XmlSerializer(myProperties.GetType());
                myProperties = (HisLisProperties)mySerializer.Deserialize(myFileStream);
                myFileStream.Close();
                return(myProperties);
            }
            catch (Exception ex)
            {
                return(new HisLisProperties());
            }
        }
        /// <summary>
        /// Các Hàm sử dụng trong Form
        /// </summary>
        /// <returns></returns>

        #region Function
        public static HisLisProperties GetServiceConfig()
        {
            try
            {
                var myProperties = new HisLisProperties();
                string filePath = string.Format("{0}{1}.xml", AppPath, myProperties.GetType().Name);
                var myFileStream = new FileStream(filePath, FileMode.Open);
                var mySerializer = new XmlSerializer(myProperties.GetType());
                myProperties = (HisLisProperties) mySerializer.Deserialize(myFileStream);
                myFileStream.Close();
                return myProperties;
            }
            catch (Exception ex)
            {
                return new HisLisProperties();
            }
        }