Exemplo n.º 1
0
        public override XmlNode GetSingleNode(string path, bool navigateAttributeWise = true)
        {
            var xPath = new XPath.XPath(path, navigateAttributeWise);
            var node  = SettingsStorage.SelectSingleNode(SettingsXPathCreator.CreateXPath(xPath));

            return(node);
        }
Exemplo n.º 2
0
        public override string GetPropertyValueData(string path, string propertyName, bool navigateAttributeWise = true)
        {
            var xPath = new XPath.XPath(path, navigateAttributeWise);
            var node  = SettingsStorage.SelectSingleNode(
                SettingsXPathCreator.CreatePropertyValeXPath(xPath, propertyName));
            var value = node?.InnerText;

            return(value);
        }
Exemplo n.º 3
0
        public override string GetAttributeValue(string path, string attribute, bool navigateAttributeWise = true)
        {
            var xPath = new XPath.XPath(path, navigateAttributeWise);
            var value = SettingsStorage
                        .SelectSingleNode(SettingsXPathCreator.CreateElementAttributeValueXPath(xPath, attribute))
                        ?.Value;

            return(value);
        }
Exemplo n.º 4
0
        public override string GetPropertyValueData(XmlNode node, string propertyName)
        {
            var nodePath = SettingsXPathCreator.CreateNodeXPath(node) +
                           SettingsXPathCreator.CreatePropertyValeXPath(null, propertyName,
                                                                        XPathCreationOptions.Absolute, false);
            var result = SettingsStorage.SelectSingleNode(nodePath);
            var value  = result?.InnerText;

            return(value);
        }
Exemplo n.º 5
0
        public override IEnumerable <XmlNode> GetChildNodes(string path, bool navigateAttributeWise = true)
        {
            var xPath = new XPath.XPath(path, navigateAttributeWise);
            var nodes = SettingsStorage.SelectSingleNode(SettingsXPathCreator.CreateXPath(xPath));

            if (nodes == null || !nodes.HasChildNodes)
            {
                return(new List <XmlNode>());
            }
            return(nodes.ChildNodes.Cast <XmlNode>().ToList());
        }
Exemplo n.º 6
0
        public override string GetPropertyValueData(XmlNode node, string path, string propertyName,
                                                    bool navigateAttributeWise = true)
        {
            var nodePath  = SettingsXPathCreator.CreateNodeXPath(node);
            var xPath     = new XPath.XPath(path, navigateAttributeWise);
            var additPath =
                nodePath + SettingsXPathCreator.CreatePropertyValeXPath(xPath, propertyName,
                                                                        XPathCreationOptions.AllowEmpty);
            var result = SettingsStorage.SelectSingleNode(additPath);
            var value  = result?.InnerText;

            return(value);
        }