A group node returned by the ICollectionView.Groups implementation of the EntityQueryPagedCollectionView.
Internal use only.
Inheritance: System.Windows.Data.CollectionViewGroup
コード例 #1
0
 /// <summary>
 /// Internal use only.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="level"></param>
 /// <param name="parent"></param>
 public CollectionViewGroupNode(object name, int level, CollectionViewGroupNode parent)
     : base(name)
 {
     _parent = parent;
     _level  = level;
     _root   = GetRoot();
 }
コード例 #2
0
        private CollectionViewGroupNode GetGroupNode(int level, object name)
        {
            var node = this.Items.Cast <CollectionViewGroupNode>().Where(n => object.Equals(n.Name, name)).FirstOrDefault();

            if (node == null)
            {
                node = new CollectionViewGroupNode(name, level, this);
                AddItem(node);
            }
            return(node);
        }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 /// <param name="level"></param>
 /// <param name="parent"></param>
 protected void AddItemToGroup(object item, int level, CollectionViewGroupNode parent)
 {
     if (IsBottomLevel)
     {
         AddItem(item);
     }
     else
     {
         var gd        = _root.GroupDescriptions[level];
         var groupName = gd.GroupNameFromItem(item, level, System.Globalization.CultureInfo.CurrentCulture);
         int newLevel  = level + 1;
         var node      = GetGroupNode(newLevel, groupName);
         node.AddItemToGroup(item, newLevel, this);
     }
 }
コード例 #4
0
 bool IEnumerator.MoveNext()
 {
     while ((_subEnum == null) || !_subEnum.MoveNext())
     {
         _index++;
         if (_index >= _group.Items.Count)
         {
             return(false);
         }
         CollectionViewGroupNode node = _group.Items[_index] as CollectionViewGroupNode;
         if (node == null)
         {
             _current = _group.Items[_index];
             _subEnum = null;
             return(true);
         }
         _subEnum = node.GetLeafEnumerator();
     }
     _current = _subEnum.Current;
     return(true);
 }
コード例 #5
0
 public LeafEnumerator(CollectionViewGroupNode group)
 {
     _group = group;
     DoReset();
 }
コード例 #6
0
 public LeafEnumerator(CollectionViewGroupNode group) {
   _group = group;
   DoReset();
 }
コード例 #7
0
 private CollectionViewGroupNode GetGroupNode(int level, object name) {
   var node = this.Items.Cast<CollectionViewGroupNode>().Where(n => object.Equals(n.Name, name)).FirstOrDefault();
   if (node == null) {
     node = new CollectionViewGroupNode(name, level, this);
     AddItem(node);
   }
   return node;
 }
コード例 #8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="item"></param>
 /// <param name="level"></param>
 /// <param name="parent"></param>
 protected void RemoveItemFromGroup(object item, int level, CollectionViewGroupNode parent) {
   if (IsBottomLevel) {
     RemoveItem(item);
     RemoveGroupIfEmpty();
   } else {
     var gd = _root.GroupDescriptions[level];
     var groupName = gd.GroupNameFromItem(item, level, System.Globalization.CultureInfo.CurrentCulture);
     int newLevel = level + 1;
     var node = GetGroupNode(newLevel, groupName);
     node.RemoveItemFromGroup(item, newLevel, this);
   }
 }
コード例 #9
0
 /// <summary>
 /// Internal use only.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="level"></param>
 /// <param name="parent"></param>
 public CollectionViewGroupNode(object name, int level, CollectionViewGroupNode parent)
   : base(name) {
   _parent = parent;
   _level = level;
   _root = GetRoot();
 }