/* * GroupingParameters - All the data that is used to create groups in an ObjectListView * * Author: Phillip Piper * Date: 31-March-2011 5:53 pm * * Change log: * 2011-03-31 JPP - Split into its own file * * Copyright (C) 2011-2014 Phillip Piper * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * If you wish to use this code in a closed source application, please contact phillip_piper@bigfoot.com. */ using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace BrightIdeasSoftware { /// /// This class contains all the settings used when groups are created /// public class GroupingParameters { /// /// Create a GroupingParameters /// /// /// /// /// /// /// /// /// /// /// public GroupingParameters(ObjectListView olv, OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder, string titleFormat, string titleSingularFormat, bool sortItemsByPrimaryColumn) { this.ListView = olv; this.GroupByColumn = groupByColumn; this.GroupByOrder = groupByOrder; this.PrimarySort = column; this.PrimarySortOrder = order; this.SecondarySort = secondaryColumn; this.SecondarySortOrder = secondaryOrder; this.SortItemsByPrimaryColumn = sortItemsByPrimaryColumn; this.TitleFormat = titleFormat; this.TitleSingularFormat = titleSingularFormat; } /// /// Gets or sets the ObjectListView being grouped /// public ObjectListView ListView { get { return this.listView; } set { this.listView = value; } } private ObjectListView listView; /// /// Gets or sets the column used to create groups /// public OLVColumn GroupByColumn { get { return this.groupByColumn; } set { this.groupByColumn = value; } } private OLVColumn groupByColumn; /// /// In what order will the groups themselves be sorted? /// public SortOrder GroupByOrder { get { return this.groupByOrder; } set { this.groupByOrder = value; } } private SortOrder groupByOrder; /// /// If this is set, this comparer will be used to order the groups /// public IComparer GroupComparer { get { return this.groupComparer; } set { this.groupComparer = value; } } private IComparer groupComparer; /// /// If this is set, this comparer will be used to order items within each group /// public IComparer ItemComparer { get { return this.itemComparer; } set { this.itemComparer = value; } } private IComparer itemComparer; /// /// Gets or sets the column that will be the primary sort /// public OLVColumn PrimarySort { get { return this.primarySort; } set { this.primarySort = value; } } private OLVColumn primarySort; /// /// Gets or sets the ordering for the primary sort /// public SortOrder PrimarySortOrder { get { return this.primarySortOrder; } set { this.primarySortOrder = value; } } private SortOrder primarySortOrder; /// /// Gets or sets the column used for secondary sorting /// public OLVColumn SecondarySort { get { return this.secondarySort; } set { this.secondarySort = value; } } private OLVColumn secondarySort; /// /// Gets or sets the ordering for the secondary sort /// public SortOrder SecondarySortOrder { get { return this.secondarySortOrder; } set { this.secondarySortOrder = value; } } private SortOrder secondarySortOrder; /// /// Gets or sets the title format used for groups with zero or more than one element /// public string TitleFormat { get { return this.titleFormat; } set { this.titleFormat = value; } } private string titleFormat; /// /// Gets or sets the title format used for groups with only one element /// public string TitleSingularFormat { get { return this.titleSingularFormat; } set { this.titleSingularFormat = value; } } private string titleSingularFormat; /// /// Gets or sets whether the items should be sorted by the primary column /// public bool SortItemsByPrimaryColumn { get { return this.sortItemsByPrimaryColumn; } set { this.sortItemsByPrimaryColumn = value; } } private bool sortItemsByPrimaryColumn; } }