예제 #1
0
        public questStatus ParseNavbarContext()
        {
            // Initialize
            questStatus status = null;

            char[] delimiters = { '[', ']' };

            // Parse
            try
            {
                Navbar _navbar = new Navbar();
                for (int index = 0; index < _httpRequestBase.QueryString.AllKeys.Length; index++)
                {
                    string   key   = _httpRequestBase.QueryString.AllKeys[index];
                    string[] parts = key.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
                    if (parts.Length == 0)
                    {
                        continue;
                    }
                    if (parts[0] == "nb")
                    {
                        if (parts[1] == "ctx")
                        {
                            string CurrentItem = _httpRequestBase.QueryString[index];

                            // TODO: set bCurrentItem = true in MainMenu
                            status = _navbar.SetCurrentItem(CurrentItem);
                            if (questStatusDef.IsWarning(status))
                            {
                                _navbar.CurrentItem = CurrentItem;
                            }
                        }
                    }
                }
                this._navbar = _navbar;
            }
            catch (System.Exception ex)
            {
                return(new questStatus(Severity.Error, String.Format("Error parsing Navbar context: " + ex.Message)));
            }
            return(new questStatus(Severity.Success));
        }