예제 #1
0
        /// <summary>
        /// Adds a DataGridGroup to the list of groups specified by the available header name for a DataGrid.
        /// </summary>
        public DataGridGroup Add(string headerName)
        {
            foreach (DataGridGroup dg in List)
            {
                if (dg.Header.Name == headerName)
                {
                    return(dg);
                }
            }
            DataGridHeader header = null;

            foreach (DataGridHeader dh in _owner._headers)
            {
                if (dh.Name == headerName)
                {
                    header = dh;
                    break;
                }
            }
            if (header != null)
            {
                DataGridGroup group = new DataGridGroup(_owner, header);
                int           index = List.Add(group);
                return((DataGridGroup)List[index]);
            }
            return(null);
        }
예제 #2
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the collection.
 /// </summary>
 /// <param name="group">The object to remove from the collection.</param>
 /// <returns>true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the collection.</returns>
 public bool Remove(DataGridGroup group)
 {
     if (List.Contains(group))
     {
         List.Remove(group);
         return(true);
     }
     return(false);
 }
예제 #3
0
        /// <summary>
        /// Swaps the position between 2 groups in this collection.
        /// </summary>
        /// <param name="group1">The first DataGridGroup object to be swapped.</param>
        /// <param name="group2">The second DataGridGroup object to be swapped.</param>
        /// <returns>true, if the operation executed successfully, otherwise, false.</returns>
        internal bool swapGroup(DataGridGroup group1, DataGridGroup group2)
        {
            bool result = false;

            internalCalls = true;
            if (Contains(group1) && Contains(group2))
            {
                result = true;
                int idx1 = List.IndexOf(group1);
                int idx2 = List.IndexOf(group2);
                List[idx1] = group2;
                List[idx2] = group1;
                if (GroupSwapped != null)
                {
                    GroupSwapped(this, new EventArgs());
                }
            }
            internalCalls = false;
            return(result);
        }
예제 #4
0
 /// <summary>
 /// Returns the index within the collection of the specified group.
 /// </summary>
 /// <param name="item">A DataGridGroup object representing the group to locate in the collection.</param>
 /// <returns>The zero-based index where the group is located within the collection; otherwise, negative one (-1).</returns>
 public int IndexOf(DataGridGroup group)
 {
     return(List.IndexOf(group));
 }
예제 #5
0
 /// <summary>
 /// Moves a DataGridGroup object to the last position in this collection.
 /// </summary>
 /// <param name="group">A DataGridGroup object to be moved.</param>
 /// <returns>true, if the operation executed successfully, otherwise, false.</returns>
 internal bool moveLast(DataGridGroup group)
 {
     return(moveGroup(List.Count - 1, group));
 }
예제 #6
0
 /// <summary>
 /// Moves a DataGridGroup object to the first index in this collection.
 /// </summary>
 /// <param name="group">A DataGridGroup object to be moved.</param>
 /// <returns>true, if the operation executed successfully, otherwise, false.</returns>
 internal bool moveFirst(DataGridGroup group)
 {
     return(moveGroup(0, group));
 }
예제 #7
0
 /// <summary>
 /// Determines whether an element is in the collection.
 /// </summary>
 /// <param name="group">The object to locate in the collection.</param>
 /// <returns>true if group is found in the collection; otherwise, false</returns>
 public bool Contains(DataGridGroup group)
 {
     return(List.Contains(group));
 }
예제 #8
0
 public DataGridGroupSummarize(DataGridGroup owner) { _owner = owner; }
예제 #9
0
 public DataGridGroupSummarize() { _owner = new DataGridGroup(); }
예제 #10
0
 public DataGridGroupSummarizeCollection(DataGridGroup owner) : base() { _owner = owner; }