private void Generate(SiteSettings siteSettingItem)
 {
     if (!siteSettingItem.GenerateOnCall)
     {
         var tree = new MenuTreeManager(siteSettingItem).CreateTree();
         if (_storageManager != null)
         {
             _storageManager.Write(siteSettingItem, tree);
         }
     }
 }
        private MenuItem GetContextSiteMenu()
        {
            LoadSettings();
            var siteSettings = GetContextSiteSettings(PushMenuSettings);

            if (siteSettings != null)
            {
                MenuItem tree;
                if (siteSettings.GenerateOnCall)
                {
                    tree = new MenuTreeManager(siteSettings).CreateTree();
                }
                else
                {
                    siteSettings.GenerateOnCall = true;
                    tree = _storageManager.Read(siteSettings) ?? new MenuTreeManager(siteSettings).CreateTree();
                }

                return(tree);
            }

            return(null);
        }