本文整理汇总了C#中System.Windows.Forms.RetrieveVirtualItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# RetrieveVirtualItemEventArgs类的具体用法?C# RetrieveVirtualItemEventArgs怎么用?C# RetrieveVirtualItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RetrieveVirtualItemEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了RetrieveVirtualItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: listViewResults_RetrieveVirtualItem
void listViewResults_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
if (e.ItemIndex >= 0 && e.ItemIndex < dataStream.Length)
{
e.Item = new ListViewItem(dataStream[e.ItemIndex]);
}
}
示例2: listView_RetrieveVirtualItem
private void listView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
// Check if the item is in the local cache.
DataRow match = null;
if (dtCachedItems != null)
match = dtCachedItems.Rows.Find(e.ItemIndex + 1);
if (match == null)
{
// The item isn't in memory.
// Get a new range of 100 records.
int from, to;
if (e.ItemIndex < 50)
from = 0;
else
from = (e.ItemIndex - 50);
to = from + 100;
dtCachedItems = NorthwindDB.GetOrders(from, to);
// Don't use the MessageBox to show this information.
// Hiding any part of the ListView can retrigger this event.
lblStatus.Text = String.Format(
"Fetched rows from {0} to {1}.",
from.ToString(), to.ToString());
match = dtCachedItems.Rows.Find(e.ItemIndex + 1);
}
// Create the ListViewItem for the matching record.
e.Item = new ListViewItem(match["OrderID"].ToString());
e.Item.SubItems.Add(match["ShippedDate"].ToString());
}
示例3: OnRetrieveVirtualItem
void OnRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
var item=_vmd.BoneMotions[e.ItemIndex];
e.Item = new ListViewItem(new string[]{
item.BoneName,
item.FrameNum.ToString()
});
}
示例4: SearchResultsListViewRetrieveVItem
private void SearchResultsListViewRetrieveVItem(object sender, RetrieveVirtualItemEventArgs e)
{
Contract.Requires(e.ItemIndex >= 0);
Contract.Requires(e.ItemIndex < this._vehicleResults.Count);
var vehicle = _vehicleResults[e.ItemIndex];
e.Item = new ListViewItem(new[] { vehicle.Id.ToString(), VehicleInfo.GetUsedCount(vehicle).ToString()});
}
示例5: ResultList_RetrieveVirtualItem
private void ResultList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
if (e.ItemIndex < _searchResultInfos.Count)
{
ListViewItem listViewItem = new ListViewItem { Text = _searchResultInfos[e.ItemIndex].Title };
e.Item = listViewItem;
}
}
示例6: EnumerationListView_RetrieveVirtualItem
public void EnumerationListView_RetrieveVirtualItem(object Sender, RetrieveVirtualItemEventArgs e)
{
if (e.ItemIndex < 0 || e.ItemIndex >= enumeration.Count)
return;
IdentifiableName item = enumeration[e.ItemIndex];
e.Item = new ListViewItem();
e.Item.Text = item.Id.ToString();
e.Item.SubItems.Add(item.Name);
}
示例7: listViewPrimeNumberList_RetrieveVirtualItem
private void listViewPrimeNumberList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
e.Item = new ListViewItem(e.ItemIndex.ToString());
bool lock_taken = false;
calculator.BeginAccessData(ref lock_taken);
e.Item.SubItems.Add(calculator.PrimeNumberList[e.ItemIndex].ToString());
calculator.EndAccessData();
}
示例8: OnRetrieveVirtualItem
protected override void OnRetrieveVirtualItem(RetrieveVirtualItemEventArgs e)
{
base.OnRetrieveVirtualItem(e);
if (mCache[e.ItemIndex] != null) {
e.Item = mCache[e.ItemIndex];
}
else {
ListViewItem item = new ListViewItem(mItems[e.ItemIndex].OrignalLine.Replace("\t", " "));
e.Item = item;
mCache[e.ItemIndex] = item;
}
}
示例9: OnRetrieveVirtualItem
/// <summary>
/// Called when the control need a virtual item.
/// </summary>
/// <param name="e">The event object the user needs to fill up.</param>
protected override void OnRetrieveVirtualItem(RetrieveVirtualItemEventArgs e)
{
// Get the list view item from the user.
base.OnRetrieveVirtualItem(e);
if (e.Item != null)
{
// Go over all the sub items in the list view
foreach (ListViewItem.ListViewSubItem subItem in e.Item.SubItems)
{
// If an items text is 260 characters long, add a space so it does
// not crash the program.
if (subItem.Text.Length == 260)
{
subItem.Text = subItem.Text + " ";
}
}
}
}
示例10: listView_players_data_RetrieveVirtualItem
/***********************************************/
void listView_players_data_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
try
{
e.Item = (ListViewItem)listView_players_data_items[e.ItemIndex];
return;
}
catch
{
e.Item = new ListViewItem();
e.Item.SubItems.Add("");
e.Item.SubItems.Add("");
e.Item.SubItems.Add("");
e.Item.SubItems.Add("");
e.Item.SubItems.Add("");
e.Item.ImageIndex = -1;
}
}
示例11: RetrieveVirtualItem
private void RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
if (mCachedItem == null || mLastUpdatedItemIndex != e.ItemIndex)
{
e.Item = new ListViewItem(e.ItemIndex.ToString());
mCachedItem = e.Item;
StoredLine line = mStorage[e.ItemIndex];
e.Item.SubItems.Add(mSession.GetTimestamp(line.Ticks));
e.Item.SubItems.Add(mSession.GetProcessName(line.Pid) ?? line.Pid.ToString());
e.Item.SubItems.Add(mStorage.GetString(e.ItemIndex));
mLastUpdatedItemIndex = e.ItemIndex;
}
else
{
// we cache the listviewitem because the listview requests the same item very often!?
e.Item = mCachedItem;
}
}
示例12: _culturesList_RetrieveVirtualItem
private void _culturesList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
CultureInfo ci = _cultures[e.ItemIndex];
string[] items;
Color c;
if (ci == CultureInfo.InvariantCulture)
{
items = new string[] { "(default)", "Default Culture" };
c = Color.Gray;
}
else
{
items = new string[] { ci.Name, ci.DisplayName };
c = Color.Black;
}
e.Item = new ListViewItem(items,
ci.IsNeutralCulture || ci == CultureInfo.InvariantCulture ? 0 : 1);
e.Item.ForeColor = c;
}
示例13: MemoryView_RetrieveVirtualItem
private void MemoryView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
ListViewItem theItem;
int i;
ulong toRead = mAddress + (ulong)(e.ItemIndex << 4);
if (mStoredBytes.TryGetValue(toRead, out theItem))
{
e.Item = theItem;
return;
}
StringBuilder resultName = new StringBuilder(string.Format("{0:X8}:", toRead));
for (i = 0; i < 16; i++)
resultName.Append(" ??");
e.Item = new ListViewItem(resultName.ToString());
mStoredBytes[toRead] = e.Item;
ThreadPool.QueueUserWorkItem(UpdateRow, toRead);
}
示例14: HandleRetrieveVirtualItem
/// <summary>
/// Handle a RetrieveVirtualItem
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected virtual void HandleRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) {
// .NET 2.0 seems to generate a lot of these events. Before drawing *each* sub-item,
// this event is triggered 4-8 times for the same index. So we save lots of CPU time
// by caching the last result.
//System.Diagnostics.Debug.WriteLine(String.Format("HandleRetrieveVirtualItem({0})", e.ItemIndex));
if (this.lastRetrieveVirtualItemIndex != e.ItemIndex) {
this.lastRetrieveVirtualItemIndex = e.ItemIndex;
this.lastRetrieveVirtualItem = this.MakeListViewItem(e.ItemIndex);
}
e.Item = this.lastRetrieveVirtualItem;
}
示例15: EventList_RetrieveVirtualItem
private void EventList_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
if (_ItemCache != null && e.ItemIndex >= _itemCacheIndex && e.ItemIndex < _itemCacheIndex + _ItemCache.Length)
{
//キャッシュヒット
e.Item = _ItemCache[e.ItemIndex - _itemCacheIndex];
}
else
{
//キャッシュミス
e.Item = CreateListViewItem(_filterdEventSource[e.ItemIndex]);
}
}