Esempio n. 1
0
            public void RetrieveVirtualItem(RetrieveVirtualItemEventArgs e)
            {
                ProgressMessage pm = this[e.ItemIndex];

                e.Item = new ListViewItem(pm.Time.ToString());
                e.Item.SubItems.Add(pm.Operation);
                e.Item.SubItems.Add(pm.Service);
                e.Item.SubItems.Add(pm.Region);
                e.Item.SubItems.Add(pm.Result);
                e.Item.ImageIndex = pm.ImageIndex;
            }
Esempio n. 2
0
        private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            e.Item = emptyItem;
            if (resultItem.Length == 0 || e.ItemIndex >= resultItem.Length)
            {
                //e.Item = emptyItem;
                return;
            }

            e.Item = resultItem[e.ItemIndex];
        }
Esempio n. 3
0
        private void FunctionView_QueryItemText(object sender, RetrieveVirtualItemEventArgs e)
        {
            var entry = _filteredList[e.ItemIndex];
            e.Item = new ListViewItem(entry.ReturnType);
            e.Item.SubItems.Add(entry.Library);

            var deprecated = entry.IsDeprecated ? "[Deprecated] " : "";
            e.Item.SubItems.Add(deprecated + entry.Name);
            e.Item.SubItems.Add(entry.ParameterList);
            e.Item.SubItems.Add(entry.Description);
        }
Esempio n. 4
0
        ///<summary>
        /// 虚拟模式事件
        ///</summary>
        ///<param name="sender"></param>
        ///<param name="e"></param>
        private void listView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            if (this.CurrentCacheItemsSource == null || this.CurrentCacheItemsSource.Count == 0)
            {
                return;
            }

            ListViewItem lv = this.CurrentCacheItemsSource[e.ItemIndex];

            e.Item = lv;
        }
Esempio n. 5
0
        /// <summary>
        /// Triggered when the list view needs to display an item.
        /// </summary>
        /// <param name="sender">The list view.</param>
        /// <param name="e">Event argument.</param>
        private void data_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            IErasureTarget target = task.Targets[e.ItemIndex];

            e.Item = new ListViewItem(PathUtil.GetCompactPath(target.ToString(),
                                                              data.Columns[0].Width, data.Font));
            e.Item.ToolTipText = target.ToString();

            e.Item.SubItems.Add(target.Method == ErasureMethodRegistrar.Default ?
                                S._("(default)") : target.Method.Name);
        }
Esempio n. 6
0
 private void lvHistory_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     if (listViewCache != null && e.ItemIndex >= listViewCacheStartIndex && e.ItemIndex < listViewCacheStartIndex + listViewCache.Length)
     {
         e.Item = listViewCache[e.ItemIndex - listViewCacheStartIndex];
     }
     else
     {
         e.Item = CreateListViewItem(e.ItemIndex);
     }
 }
 private void logListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     try
     {
         e.Item = new LogListViewItem(this.logEntries.ElementAt(e.ItemIndex), this.enableHighlightsButton.Checked ? this.ColorHighlightManager.CurrentGroup : null);
     }
     catch (Exception ex)
     {
         ShowAndLogError("Exception while retrieving virtual item: " + ex.ToString());
     }
 }
Esempio n. 8
0
        private void listView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            lock (records)
            {
                try
                {
                    Record rec;
                    if (e.ItemIndex >= records.Count)
                    {
                        //リストにないときでも、e.Itemをセットせずにコールバックから出てはいけない
                        rec         = new Record();
                        rec.Id      = -1;
                        rec.Service = "";
                        rec.Start   = DateTime.Now;
                        rec.End     = DateTime.Now;
                        rec.Title   = "";
                        rec.Status  = 0;
                        rec.Tuner   = "";
                        rec.Host    = "";
                        rec.Time    = "";
                    }
                    else
                    {
                        rec = records[e.ItemIndex];
                    }

                    var item = new ListViewItem();

                    item.Text = rec.Title;
                    item.SubItems.Add(rec.Service);
                    item.SubItems.Add(rec.Time);

                    var status = "OK";
                    if ((rec.Status & (int)RecStatus.Duplication) > 0)
                    {
                        status         = "重複";
                        item.BackColor = System.Drawing.Color.Gold;
                    }
                    if ((rec.Status & (int)RecStatus.Recoding) > 0)
                    {
                        status         = "録画中";
                        item.BackColor = System.Drawing.Color.LightCoral;
                    }
                    item.SubItems.Add(status);

                    item.SubItems.Add(rec.Host);
                    item.SubItems.Add(rec.Tuner);

                    e.Item = item;
                }
                catch { }
            }
        }
Esempio n. 9
0
        private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            // Событие вывода в виртуальную таблицу Заказов
            int c = Base.classOrder.dataSet.Tables[0].Rows.Count;

            if (((c > 0) && (e.ItemIndex < c)) && (e.ItemIndex > -1))
            {
                DataRow row = Base.classOrder.dataSet.Tables[0].Rows[e.ItemIndex];
                e.Item = new ListViewItem(new string[] { (e.ItemIndex + 1).ToString(), row[1].ToString(),
                                                         row[2].ToString(), Order.statusmas[Int32.Parse(row[3].ToString())], row[4].ToString() });
            }
        }
Esempio n. 10
0
 private void logListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     if (_logBuffer[e.ItemIndex].ShowTimeStamp)
     {
         e.Item = new ListViewItem(_logBuffer[e.ItemIndex].TimeStamp.ToString("dd MMM HH:mm:ss"));
     }
     else
     {
         e.Item = new ListViewItem();
     }
     e.Item.SubItems.Add(_logBuffer[e.ItemIndex].Message);
 }
Esempio n. 11
0
 /// <summary>
 /// Get the index of the specified item
 /// </summary>
 private void GetVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     // If we have the item cached, return it. Otherwise, recreate it.
     if (cache != null && e.ItemIndex >= firstItem && e.ItemIndex < firstItem + cache.Length)
     {
         e.Item = cache[e.ItemIndex - firstItem];
     }
     else
     {
         e.Item = GetListItem(e.ItemIndex);
     }
 }
Esempio n. 12
0
            public void RetrieveVirtualItem(RetrieveVirtualItemEventArgs e)
            {
                CloudObject cobo = this[e.ItemIndex];

                e.Item = new ListViewItem(cobo.Service);
                e.Item.SubItems.Add(cobo.TypeName);
                e.Item.SubItems.Add(cobo.Region);
                e.Item.SubItems.Add(cobo.Names.FirstValue);
                e.Item.SubItems.Add(cobo.Ids.FirstValue);
                e.Item.SubItems.Add(cobo.Arns.FirstValue);
                e.Item.Tag = cobo;
            }
Esempio n. 13
0
 void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     if (e.ItemIndex < lvitem_cache.Length)
     {
         e.Item = lvitem_cache[e.ItemIndex];
     }
     else
     {
         int x = e.ItemIndex * e.ItemIndex;
         e.Item = new ListViewItem(x.ToString());
     }
 }
 private void listView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     if (e.ItemIndex >= firstCachedItemIndex &&
         e.ItemIndex < firstCachedItemIndex + cachedItems.Count)
     {
         e.Item = cachedItems[e.ItemIndex - firstCachedItemIndex];
     }
     else
     {
         e.Item = GetItem(e.ItemIndex);
     }
 }
Esempio n. 15
0
 /// <summary>
 /// リストビューの仮想化
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LsvResult_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     if (e.ItemIndex < m_lstSelPathList.Count)
     {
         if (e.Item == null)
         {
             e.Item = new ListViewItem();
         }
         e.Item.Text       = m_lstSelPathList[e.ItemIndex].strPath;
         e.Item.ImageIndex = m_lstSelPathList[e.ItemIndex].TypeI;
     }
 }
Esempio n. 16
0
        private unsafe void listExports_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            ImageExportEntry    entry    = this._mappedImage.Exports.GetEntry(e.ItemIndex);
            ImageExportFunction function = this._mappedImage.Exports.GetFunction(entry.Ordinal);

            e.Item = new ListViewItem(new string[]
            {
                entry.Ordinal.ToString(),
                !string.IsNullOrEmpty(function.ForwardedName) ? entry.Name + " > " + function.ForwardedName : entry.Name,
                string.IsNullOrEmpty(function.ForwardedName) ? "0x" + function.Function.Decrement(new IntPtr(this._mappedImage.Memory)).ToString("x") : string.Empty
            });
        }
Esempio n. 17
0
 private void BindingListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     if (e.ItemIndex >= lvcacheStart && e.ItemIndex <= lvcacheEnd)
     {
         e.Item = lvcache[e.ItemIndex - lvcacheStart];
     }
     else
     {
         e.Item = CreateBlankListViewItem();
         FillListViewItem(e.Item, e.ItemIndex);
     }
 }
Esempio n. 18
0
        private void listViewThreads_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            BBSThread    thread = filteredBBSThreads[e.ItemIndex];
            ListViewItem item   = virtualListViewItems[e.ItemIndex];

            if (item == null)
            {
                item = thread.CreateListViewItem();
                virtualListViewItems[e.ItemIndex] = item;
            }
            e.Item = item;
        }
Esempio n. 19
0
 /// <summary>
 /// Handle a RetrieveVirtualItem
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected 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.
     if (this.lastRetrieveVirtualItemIndex != e.ItemIndex)
     {
         this.lastRetrieveVirtualItemIndex = e.ItemIndex;
         this.lastRetrieveVirtualItem      = this.MakeListViewItem(e.ItemIndex);
     }
     e.Item = this.lastRetrieveVirtualItem;
 }
 public void EnumerationListView_RetrieveVirtualItem(object Sender, RetrieveVirtualItemEventArgs e)
 {
     if (e.ItemIndex < 0 || e.ItemIndex >= enumeration.Count)
     {
         return;
     }
     Enumerations.EnumerationItem item = enumeration[e.ItemIndex];
     e.Item      = new ListViewItem();
     e.Item.Text = item.Id.ToString();
     e.Item.SubItems.Add(item.Name);
     e.Item.SubItems.Add(item.IsDefault.ToString());
 }
Esempio n. 21
0
        private void lvMatrix_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            ListViewItem listViewItem = new ListViewItem();
            CultureInfo  cultureInfo  = CultureInfo.GetCultureInfo("en-US");

            listViewItem.Text = this._matrix[e.ItemIndex, 0].ToString((IFormatProvider)cultureInfo);
            for (int index = 1; index < this._matrixCols; ++index)
            {
                listViewItem.SubItems.Add(this._matrix[e.ItemIndex, index].ToString((IFormatProvider)cultureInfo));
            }
            e.Item = listViewItem;
        }
Esempio n. 22
0
        private void lvEntries_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            if (_stringList.Entries.Count == 0)
            {
                return;
            }

            var entry = _stringList.Entries[e.ItemIndex];

            e.Item = new ListViewItem(entry.Number.ToString());
            e.Item.SubItems.Add(entry.Text);
        }
Esempio n. 23
0
        private void MainListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            var acc = aDatResult[e.ItemIndex];

            e.Item = new ListViewItem(
                new string[]
                { acc[0].ToString(), acc[1].ToString(), acc[2].ToString(), acc[3].ToString(), acc[4].ToString(), acc[5].ToString(), acc[6].ToString(), acc[7].ToString() })
            {
                Tag       = acc,
                BackColor = e.ItemIndex % 2 == 0 ? Color.Beige : Color.White
            };
        }
Esempio n. 24
0
        private void ListView_RetrieveVirtualItem(
            object sender, RetrieveVirtualItemEventArgs e)
        {
            DataNode node = this.listViewNodeList[e.ItemIndex];

            ListViewItem lvi = new ListViewItem(node.Name);

            lvi.SubItems.Add(Helper.GetSizeString(node.Size));
            lvi.IndentCount = node.Layer - 1;

            e.Item = lvi;
        }
Esempio n. 25
0
 protected override void OnRetrieveVirtualItem(RetrieveVirtualItemEventArgs e)
 {
     // If we have the item cached, return it. Otherwise, recreate it.
     if (fCache != null && e.ItemIndex >= fCacheFirstItem && e.ItemIndex < fCacheFirstItem + fCache.Length)
     {
         e.Item = fCache[e.ItemIndex - fCacheFirstItem];
     }
     else
     {
         e.Item = GetVirtualItem(e.ItemIndex);
     }
 }
Esempio n. 26
0
 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]);
     }
 }
Esempio n. 27
0
        private void RpfSearchResultsListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            var item = new ListViewItem();

            if (e.ItemIndex < RpfSearchResults.Count)
            {
                RpfSearchResult r = RpfSearchResults[e.ItemIndex];
                item.Text = r.FileEntry.Name;
                item.SubItems.Add(r.Offset.ToString());
                item.Tag = r;
            }
            e.Item = item;
        }
Esempio n. 28
0
    private void List_RetrieveVirtualItem(object?sender, RetrieveVirtualItemEventArgs e)
    {
        string[] LineInfo;
        int      index = ReversableIndex(e.ItemIndex, true);

        //this only makes senes knowing that it is really an IList
        // for a pure IEnumerable this will kill performance
        var Line = CurrentLines.Entries.ElementAt(index);

        LineInfo = new string[] { TimestampOptions.ConvertToString(Line.Timestamp), Line.Level, Line.Message };

        e.Item = new ListViewItem(LineInfo);
    }
Esempio n. 29
0
        /// <summary>
        /// Obtiene el item correspondiente a un índice de fila dado para una tabla determinada.
        /// Esta función se ejecuta cada vez que una tabla necesita mostrar un item en la pantalla.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        private void OnRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            var id   = GetPacketIdFromTableItemIndex(sender, e.ItemIndex);
            var item = ListItems[id];

            // Si el item está desactualizado lo vuelve a crear
            if (LastUIChange > item.Time)
            {
                ReloadItem(id);
            }

            e.Item = item;
        }
Esempio n. 30
0
        private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            Visualisable item = this._items[e.ItemIndex];

            e.Item            = new ListViewItem(item.DisplayName);
            e.Item.ImageIndex = this.GeneratePreviewImage(item);

            if (item.Hidden)
            {
                e.Item.ForeColor = Color.Gray;
                e.Item.Font      = FontHelper.StrikeFont;
            }
        }
Esempio n. 31
0
	void ListViewRetrieveItem (object o, RetrieveVirtualItemEventArgs args)
	{
		if (args.ItemIndex == ItemsCount -1 && !IsHandleCreated)
			warning_label.Text = "Warning: The very last item was requested, which should not happen in load time (not visible yet)";

		// for testing purposes, we are creating one item per
		// invocation
		ListViewItem item = new ListViewItem ("Item #" + args.ItemIndex);
		item.SubItems.Add ("Sub item " + args.ItemIndex + "-1");
		item.SubItems.Add ("Sub item " + args.ItemIndex + "-2");
		if (lv.View == View.Details && args.ItemIndex % 2 == 0)
			item.BackColor = Color.WhiteSmoke;

		item.ImageIndex = args.ItemIndex % Images.Length;
		args.Item = item;
	}