예제 #1
0
 protected virtual void InitializeNavigatorInfoVisible(BaseNavigatorInfoVisibleEventArgs args)
 {
     if (HideIfEmpty && args.SelectedValue == null)
     {
         args.Visible = false;
     }
 }
예제 #2
0
        /// <summary>
        /// Получить аргументы для определения видимости ссылок.
        /// </summary>
        /// <returns></returns>
        protected BaseNavigatorInfoVisibleEventArgs GetVisibleArgs(IDictionary <string, string> values, string referenceKey, BaseNavigatorValues navigatorValues)
        {
            var keyCache = ReferenceCacheKey + ".Args." + referenceKey;
            BaseNavigatorInfoVisibleEventArgs args = null;

            if (HttpContext.Current != null)
            {
                args = HttpContext.Current.Items[keyCache] as BaseNavigatorInfoVisibleEventArgs;
            }
            if (args != null)
            {
                return(args);
            }
            args = new BaseNavigatorInfoVisibleEventArgs
            {
                SelectedValue = GetKeyValue(values, referenceKey, false),
                Values        = navigatorValues
            };
            InitializeNavigatorInfoVisible(args);
            if (HttpContext.Current != null)
            {
                HttpContext.Current.Items[keyCache] = args;
            }
            return(args);
        }