Akka.Configuration.Config.GetNode C# (CSharp) Method

GetNode() private method

private GetNode ( string path ) : HoconValue
path string
return Akka.Configuration.Hocon.HoconValue
        private HoconValue GetNode(string path)
        {
            string[] elements = path.Split('.');
            HoconValue currentNode = Root;
            if (currentNode == null)
            {
                throw new InvalidOperationException("Current node should not be null");
            }
            foreach (string key in elements)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    if (Fallback != null)
                        return Fallback.GetNode(path);

                    return null;
                }
            }
            return currentNode;
        }

Usage Example

示例#1
0
        private HoconValue GetNode(string path)
        {
            string[]   elements    = path.Split('.');
            HoconValue currentNode = _node;

            if (currentNode == null)
            {
                if (_fallback != null)
                {
                    return(_fallback.GetNode(path));
                }

                return(null);
            }
            foreach (string key in elements)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    if (_fallback != null)
                    {
                        return(_fallback.GetNode(path));
                    }

                    return(null);
                }
            }
            return(currentNode);
        }