コード例 #1
0
        public void TestParse(string propertyLine, string expectedKey, string expectedValue)
        {
            var source = new PropertiesPropertySource(propertyLine);

            var properties = source.Load();

            Assert.AreEqual(properties.Get(expectedKey), expectedValue);
        }
コード例 #2
0
        public PropertyStore Load()
        {
            if (File.Exists(_filepath))
            {
                Log.Info(string.Format("Loading properties from {0}", _filepath));

                var rawProperties = File.ReadAllText(_filepath);
                var src           = new PropertiesPropertySource(rawProperties);
                return(src.Load());
            }
            else
            {
                Log.Warn(string.Format("Properties file not found ({0})!", _filepath));
            }

            return(new PropertyStore());
        }
コード例 #3
0
        public PropertyStore Load()
        {
            if (File.Exists(_filepath))
            {
                Log.Info(string.Format("Loading properties from {0}", _filepath));

                var rawProperties = File.ReadAllText(_filepath);
                var src = new PropertiesPropertySource(rawProperties);
                return src.Load();
            }
            else
            {
                Log.Warn(string.Format("Properties file not found ({0})!", _filepath));
            }

            return new PropertyStore();
        }