Universe.Modules.Web.GridPage.RemovePageByLocation C# (CSharp) Method

RemovePageByLocation() public method

public RemovePageByLocation ( string menuLocation, GridPage replacePage ) : void
menuLocation string
replacePage GridPage
return void
        public void RemovePageByLocation (string menuLocation, GridPage replacePage)
        {
            GridPage foundPage = null;
            foreach (var page in Children) {
                if (page.Location == menuLocation) {
                    foundPage = page;
                    break;
                }

                if (page.Children.Count > 0) {
                    var p = GetPageByLocation (menuLocation, page);
                    if (p != null) {
                        page.Children.Remove (p);
                        return;
                    }
                }
            }
            if (foundPage != null)
                Children.Remove (foundPage);
        }