本文整理汇总了C#中BrightIdeasSoftware.ObjectListView.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectListView.Invalidate方法的具体用法?C# ObjectListView.Invalidate怎么用?C# ObjectListView.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrightIdeasSoftware.ObjectListView
的用法示例。
在下文中一共展示了ObjectListView.Invalidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TimedFilter
void TimedFilter(ObjectListView olv, string txt, int matchKind) {
TextMatchFilter filter = null;
if (!String.IsNullOrEmpty(txt)) {
switch (matchKind) {
case 0:
default:
filter = TextMatchFilter.Contains(olv, txt);
break;
case 1:
filter = TextMatchFilter.Prefix(olv, txt);
break;
case 2:
filter = TextMatchFilter.Regex(olv, txt);
break;
}
}
// Setup a default renderer to draw the filter matches
if (filter == null) {
olv.DefaultRenderer = null;
} else {
olv.DefaultRenderer = new HighlightTextRenderer(filter);
// Uncomment this line to see how the GDI+ rendering looks
//olv.DefaultRenderer = new HighlightTextRenderer { Filter = filter, UseGdiTextRendering = false };
}
// Some lists have renderers already installed
HighlightTextRenderer highlightingRenderer = olv.GetColumn(0).Renderer as HighlightTextRenderer;
if (highlightingRenderer != null) {
highlightingRenderer.Filter = filter;
}
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
olv.AdditionalFilter = filter;
olv.Invalidate();
stopWatch.Stop();
IList objects = olv.Objects as IList;
if (objects == null) {
string msg = String.Format("Filtered in {0}ms", stopWatch.ElapsedMilliseconds);
this.toolTip1.SetToolTip(this.textBoxFilterTree, msg);
} else {
string msg = String.Format("Filtered {0} items down to {1} items in {2}ms",
objects.Count,
olv.Items.Count,
stopWatch.ElapsedMilliseconds);
this.toolTip1.SetToolTip(this.textBoxFilterTree, msg);
}
}