Exemple #1
0
        /// <summary>
        /// Callback to determine if an item in the tree is filtered in (return true) or out</summary>
        /// <param name="item">Item tested for filtering</param>
        /// <returns>True if filtered in, false if filtered out</returns>
        public bool DefaultFilter(object item)
        {
            IItemView itemView = TreeView.As <IItemView>();

            if (itemView != null)
            {
                ItemInfo info = new WinFormsItemInfo();
                itemView.GetInfo(item, info);
                return(SearchInputUI.IsNullOrEmpty() || SearchInputUI.Matches(info.Label));
            }
            return(true); // Don't filter anything if the context doesn't implement IItemView
        }
        /// <summary>
        /// Callback to determine if an item in the tree is filtered in (return true) or out</summary>
        /// <param name="item">Item tested for filtering</param>
        /// <returns>True if filtered in, false if filtered out</returns>
        public bool DefaultFilter(object item)
        {
            bool      result   = true;
            IItemView itemView = TreeView.As <IItemView>();

            if (m_TagPanel.TagList.Count != 0)
            {
                ItemInfo info = new WinFormsItemInfo();
                itemView.GetInfo(item, info);
                result = info.Label != null && m_TagPanel.Matches(info.Label);
            }
            return(result);
        }
        /// <summary>
        /// Callback to determine if an item in the tree is filtered in (return true) or out</summary>
        /// <param name="item">Item tested for filtering</param>
        /// <returns>True if filtered in, false if filtered out</returns>
        public bool DefaultFilter(object item)
        {
            bool      result   = true;
            IItemView itemView = TreeView.As <IItemView>();

            if (!SearchInputUI.IsNullOrEmpty())
            {
                ItemInfo info = new WinFormsItemInfo();
                itemView.GetInfo(item, info);
                result = info.Label != null && SearchInputUI.Matches(info.Label);
            }
            return(result);
        }
Exemple #4
0
        private static ItemInfo GetItemInfo(object item, IItemView itemView, ImageList imageList, ImageList stateImageList)
        {
            var info = new WinFormsItemInfo(imageList, stateImageList);

            if (itemView == null)
            {
                info.Label            = GetObjectString(item);
                info.Properties       = new object[0];
                info.ImageIndex       = TreeListView.InvalidImageIndex;
                info.StateImageIndex  = TreeListView.InvalidImageIndex;
                info.CheckState       = CheckState.Unchecked;
                info.FontStyle        = FontStyle.Regular;
                info.IsLeaf           = true;
                info.IsExpandedInView = false;
                info.HoverText        = string.Empty;
            }
            else
            {
                itemView.GetInfo(item, info);
            }

            return(info);
        }
        private static ItemInfo GetItemInfo(object item, IItemView itemView, ImageList imageList, ImageList stateImageList)
        {
            var info = new WinFormsItemInfo(imageList, stateImageList);

            if (itemView == null)
            {
                info.Label = GetObjectString(item);
                info.Properties = new object[0];
                info.ImageIndex = TreeListView.InvalidImageIndex;
                info.StateImageIndex = TreeListView.InvalidImageIndex;
                info.CheckState = CheckState.Unchecked;
                info.FontStyle = FontStyle.Regular;
                info.IsLeaf = true;
                info.IsExpandedInView = false;
                info.HoverText = string.Empty;
            }
            else
            {
                itemView.GetInfo(item, info);
            }

            return info;
        }