PowerArgs.Cli.PageStack.TryUp C# (CSharp) Method

TryUp() public method

public TryUp ( ) : bool
return bool
        public bool TryUp()
        {
            if (CurrentPath == null)
            {
                return false;
            }

            if (CurrentPath.IndexOf('/') < 0)
            {
                if(routes.ContainsKey("*") == false)
                {
                    return false;
                }
                else
                {
                    Navigate("*");
                    return true;
                }
            }
            else
            {
                var newPath = CurrentPath.Substring(0, CurrentPath.LastIndexOf('/'));
                Page p;
                if(TryResolveRoute(ref newPath, out p))
                {
                    Push(newPath, p);
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }