示例#1
0
            /// <summary>
            /// Partition a static IBranch instance
            /// </summary>
            /// <param name="innerBranch">The branch to partition</param>
            /// <param name="indexer">An array of indices to reorder the items in the branch (optional)</param>
            /// <param name="sections">One or more PartitionSection structures indicating how the branch should be split up. If indexer is specified, then the Start and Count properties of the partition should be relative to the indexer, not the starting branch.</param>
            public BranchPartition(IBranch innerBranch, int[] indexer, params BranchPartitionSection[] sections)
            {
                myInnerBranch = innerBranch;
                myIndexer     = indexer;
                mySections    = sections;
                int sectionCount = sections.Length;
                int totalCount   = 0;

                myInnerMultiColumnBranch = innerBranch as IMultiColumnBranch;
                BranchFeatures requiredFeatures = 0;

                for (int i = 0; i < sectionCount; ++i)
                {
                    BranchPartitionSection currentSection = sections[i];
                    int visibleCount = sections[i].VisibleItemCount;
                    if (visibleCount != 0)
                    {
                        if (currentSection.Header != null && requiredFeatures == 0)
                        {
                            requiredFeatures = BranchFeatures.Expansions | ((myInnerMultiColumnBranch != null) ? BranchFeatures.JaggedColumns : 0);
                        }
                        totalCount += visibleCount;
                    }
                }
                myItemCount = totalCount;
                myFeatures  = requiredFeatures;
            }
示例#2
0
            int IMultiColumnBranch.GetJaggedColumnCount(int row)
            {
                IMultiColumnBranch inner = myInnerMultiColumnBranch;

                if (inner == null)
                {
                    return(1);
                }
                BranchPartitionSection section;

                row = TranslateRow(row, out section);
                if (row == -1)
                {
                    return(1);
                }
                return(((myInnerBranch.Features & BranchFeatures.JaggedColumns) == 0) ? inner.ColumnCount : inner.GetJaggedColumnCount(row));
            }
示例#3
0
            SubItemCellStyles IMultiColumnBranch.ColumnStyles(int column)
            {
                IMultiColumnBranch inner = myInnerMultiColumnBranch;

                return((inner != null) ? inner.ColumnStyles(column) : SubItemCellStyles.Simple);
            }
示例#4
0
			/// <summary>
			/// Partition a static IBranch instance
			/// </summary>
			/// <param name="innerBranch">The branch to partition</param>
			/// <param name="indexer">An array of indices to reorder the items in the branch (optional)</param>
			/// <param name="sections">One or more PartitionSection structures indicating how the branch should be split up. If indexer is specified, then the Start and Count properties of the partition should be relative to the indexer, not the starting branch.</param>
			public BranchPartition(IBranch innerBranch, int[] indexer, params BranchPartitionSection[] sections)
			{
				myInnerBranch = innerBranch;
				myIndexer = indexer;
				mySections = sections;
				int sectionCount = sections.Length;
				int totalCount = 0;
				myInnerMultiColumnBranch = innerBranch as IMultiColumnBranch;
				BranchFeatures requiredFeatures = 0;
				for (int i = 0; i < sectionCount; ++i)
				{
					BranchPartitionSection currentSection = sections[i];
					int visibleCount = sections[i].VisibleItemCount;
					if (visibleCount != 0)
					{
						if (currentSection.Header != null && requiredFeatures == 0)
						{
							requiredFeatures = BranchFeatures.Expansions | ((myInnerMultiColumnBranch != null) ? BranchFeatures.JaggedColumns : 0);
						}
						totalCount += visibleCount;
					}
				}
				myItemCount = totalCount;
				myFeatures = requiredFeatures;
			}