當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.RetrieveVirtualItemEventArgs類代碼示例

本文整理匯總了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]);
     }
 }
開發者ID:mausch,項目名稱:NHWorkbench,代碼行數:7,代碼來源:ResultsView.cs

示例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());
		}
開發者ID:ehershey,項目名稱:development,代碼行數:33,代碼來源:Form1.cs

示例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()
             });
 }
開發者ID:ousttrue,項目名稱:csmeshio,代碼行數:8,代碼來源:MotionPanel.cs

示例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()});
        }
開發者ID:bobby1212,項目名稱:VehicleGarage,代碼行數:8,代碼來源:FormMain.cs

示例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;
            }
        }
開發者ID:ozok,項目名稱:TRadioPlayer,代碼行數:9,代碼來源:SearchForm.cs

示例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);
 }
開發者ID:Jopie64,項目名稱:redmine-desktop-client,代碼行數:9,代碼來源:EditEnumListForm.cs

示例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();
        }
開發者ID:EFanZh,項目名稱:EFanZh,代碼行數:9,代碼來源:MainForm.cs

示例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;
			}
		}
開發者ID:Orvid,項目名稱:Cosmos,代碼行數:13,代碼來源:ToolTipListBox.cs

示例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 + " ";
             }
         }
     }
 }
開發者ID:jkowalski,項目名稱:NLogViewer,代碼行數:22,代碼來源:SafeListView.cs

示例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; 
            }
        }
開發者ID:stephenZh,項目名稱:l2net,代碼行數:20,代碼來源:L2NET_Timers.cs

示例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;
     }
 }
開發者ID:apakian,項目名稱:buggazer,代碼行數:18,代碼來源:DBWinListView.cs

示例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;
		}
開發者ID:rsdn,項目名稱:janus,代碼行數:19,代碼來源:CultureManagerForm.cs

示例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);
        }
開發者ID:HBelusca,項目名稱:NasuTek-Odyssey-Tools,代碼行數:21,代碼來源:MemoryWindow.cs

示例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;
        }
開發者ID:printedheart,項目名稱:logwizard,代碼行數:17,代碼來源:VirtualObjectListView.cs

示例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]);
     }
 }
開發者ID:egcube,項目名稱:OpenTween,代碼行數:13,代碼來源:EventViewerDialog.cs


注:本文中的System.Windows.Forms.RetrieveVirtualItemEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。