Exemple #1
0
        protected virtual string GetHcgPath(string hcgSettingsFilePath)
        {
            string settingXml;

            using (var sr = new StreamReader(hcgSettingsFilePath))
            {
                settingXml = sr.ReadToEnd();
            }
            var xmlParser = DynamicXmlParser.Parse(settingXml);

            if (!xmlParser.HasElement("HcgPath"))
            {
                return("");
            }
            return(xmlParser.HcgPath);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="binder"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            if (_element == null)
            {
                result = null;
                return(false);
            }

            var child = _element.Element(binder.Name);

            if (child == null)
            {
                result = null;
                return(false);
            }
            else
            {
                result = new DynamicXmlParser(child);
                return(true);
            }
        }