Пример #1
0
        /// <summary>
        /// Instantiate the proper Syspro service based on passed-in type.  
        /// E.g. SysproUtils.WcfService.
        /// </summary>
        /// <param name="_sysType">Syspro connection type to use.</param>
        /// <param name="settingsPath">Path to user defined settings XML file.</param>
        public Foundation(SysproTypes _sysType, string settingsPath)
        {
            fileSettings = new Settings();
            userInfo = new UserInfo();
            sysproSettings = new SysproSettings();

            sysOpts = new Dictionary<SysproTypes, Func<bool>>()
            {
                { SysproTypes.WcfService,  NewWcf },
                { SysproTypes.COM, NewCOM }
            };

            sysType = _sysType;
        }
Пример #2
0
        private void loadFileSettings(string xmlSettings)
        {
            XmlSerializer xml = new XmlSerializer(typeof(Settings));

            try
            {
                using (XmlReader reader = XmlReader.Create(xmlSettings))
                {
                    fileSettings = (Settings)xml.Deserialize(reader);
                }
            }
            catch (Exception ex)
            {
                Logger.Log("Settings file not found: " + ex.Message);
                throw;
            }
        }