当前位置: 首页>>代码示例>>C#>>正文


C# ObjectListView.GetItemCount方法代码示例

本文整理汇总了C#中BrightIdeasSoftware.ObjectListView.GetItemCount方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectListView.GetItemCount方法的具体用法?C# ObjectListView.GetItemCount怎么用?C# ObjectListView.GetItemCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrightIdeasSoftware.ObjectListView的用法示例。


在下文中一共展示了ObjectListView.GetItemCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AutoCompleteCellEditor

        /// <summary>
        /// Create an AutoCompleteCellEditor
        /// </summary>
        /// <param name="lv"></param>
        /// <param name="column"></param>
        public AutoCompleteCellEditor(ObjectListView lv, OLVColumn column)
        {
            this.DropDownStyle = ComboBoxStyle.DropDown;

            Dictionary<String, bool> alreadySeen = new Dictionary<string, bool>();
            for (int i = 0; i < Math.Min(lv.GetItemCount(), 1000); i++) {
                String str = column.GetStringValue(lv.GetModelObject(i));
                if (!alreadySeen.ContainsKey(str)) {
                    this.Items.Add(str);
                    alreadySeen[str] = true;
                }
            }

            this.Sorted = true;
            this.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.AutoCompleteMode = AutoCompleteMode.Append;
        }
开发者ID:TaleOfTwoWastelands,项目名称:ESPSharp-GUI,代码行数:22,代码来源:CellEditors.cs

示例2: Draw

        /// <summary>
        /// Draw a slight colouring over our tinted column
        /// </summary>
        /// <remarks>
        /// This overlay only works when:
        /// - the list is in Details view
        /// - there is at least one row
        /// - there is a selected column (or a specified tint column)
        /// </remarks>
        /// <param name="olv"></param>
        /// <param name="g"></param>
        /// <param name="r"></param>
        public override void Draw(ObjectListView olv, Graphics g, Rectangle r)
        {
            if (olv.View != View.Details)
                return;

            if (olv.GetItemCount() == 0)
                return;

            OLVColumn column = ColumnToTint ?? olv.SelectedColumn;
            if (column == null)
                return;

            Point sides = NativeMethods.GetScrolledColumnSides(olv, column.Index);
            if (sides.X == -1)
                return;

            var columnBounds = new Rectangle(sides.X, r.Top, sides.Y - sides.X, r.Bottom);

            // Find the bottom of the last item. The tinting should extend only to there.
            OLVListItem lastItem = olv.GetLastItemInDisplayOrder();
            if (lastItem != null)
            {
                Rectangle lastItemBounds = lastItem.Bounds;
                if (!lastItemBounds.IsEmpty && lastItemBounds.Bottom < columnBounds.Bottom)
                    columnBounds.Height = lastItemBounds.Bottom - columnBounds.Top;
            }
            g.FillRectangle(tintBrush, columnBounds);
        }
开发者ID:rxantos,项目名称:tesv-snip,代码行数:40,代码来源:Decorations.cs

示例3: Draw

        public void Draw(ObjectListView olv, Graphics g, Rectangle r)
        {
            // This overlay only works when:
            // - the list is in Details view
            // - there is at least one row
            // - there is a selected column
            if (olv.View != System.Windows.Forms.View.Details)
                return;

            if (olv.GetItemCount() == 0)
                return;

            OLVColumn column = this.ColumnToTint ?? olv.SelectedColumn;
            if (column == null)
                return;

            Point sides = NativeMethods.GetColumnSides(olv, column.Index);
            if (sides.X == -1)
                return;

            Rectangle columnBounds = new Rectangle(sides.X, r.Top, sides.Y - sides.X, r.Bottom);

            // Find the bottom of the last item
            Rectangle lastItemBounds = olv.GetLastItemInDisplayOrder().Bounds;
            if (lastItemBounds.Bottom < columnBounds.Bottom)
                columnBounds.Height = lastItemBounds.Bottom - columnBounds.Top;
            g.FillRectangle(this.tintBrush, columnBounds);
        }
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:28,代码来源:Overlays.cs


注:本文中的BrightIdeasSoftware.ObjectListView.GetItemCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。