A group node returned by the ICollectionView.Groups implementation of the EntityQueryPagedCollectionView.
Internal use only.
Inheritance: System.Windows.Data.CollectionViewGroup
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
0
 public LeafEnumerator(CollectionViewGroupNode group)
 {
     _group = group;
     DoReset();
 }
 public LeafEnumerator(CollectionViewGroupNode group) {
   _group = group;
   DoReset();
 }
 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;
 }
 /// <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);
   }
 }
 /// <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();
 }