Sharplike.Core.Input.ControlState.GetChild C# (CSharp) Method

GetChild() private method

private GetChild ( String location, bool create ) : ControlState
location String
create bool
return ControlState
        internal ControlState GetChild(String location, bool create)
        {
            if (location == null)
                return this;

            int dotindex = location.IndexOf('.');
            String childname = null;
            String childns = null;
            if (dotindex == -1)
                childname = location;
            else
            {
                childname = location.Substring(0, dotindex);
                childns = location.Substring(dotindex + 1);
            }

            if (!children.ContainsKey(childname) && create)
            {
                ControlState cs = new ControlState(this);
                children[childname] = cs;
            }

            if (children.ContainsKey(childname))
                return children[childname].GetChild(childns, create);
            else
                return null;
        }