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


C# ListView.EndUpdate方法代码示例

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


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

示例1: DoSearch

	public static void DoSearch(string term, ListView lv, ArrayList al)
	{
		//search al and put matches in lv
		Cursor.Current = Cursors.WaitCursor;
		term = term.ToUpper();
		int rel; //serach relevence, how many terms does this item match
		string[] terms = term.Split(" ".ToCharArray());
		lv.BeginUpdate();
		lv.Items.Clear();
		if (term == "")
		{
			//return all items
			foreach (Search s in al)
			{
				ListViewItem lvi = new ListViewItem();
				lvi.Text = s.method;
				lvi.SubItems.Add(s.dll);
				lv.Items.Add(lvi);
			}
		}
		else
		{
			ArrayList found = new ArrayList();
			foreach(Search s in al)
			{
				rel = 0;
				foreach(string str in terms)
				{
					if (str != "")
					{
						if (s.method.IndexOf(str) != -1)
							rel ++;
					}
				}
				if (rel > 0)
				{
					Search foundItem = new Search(s.method, s.dll);
					foundItem.Relevence = rel;
					found.Add(foundItem);
				}
			}
			if (found.Count > 0)
			{
				found.Sort();
				foreach (Search s in found)
				{
					ListViewItem lvi = new ListViewItem();
					lvi.Text = s.method;
					lvi.SubItems.Add(s.dll);
					lv.Items.Add(lvi);
				}
			}
		}
		lv.EndUpdate();
		Cursor.Current = Cursors.Default;
	}
开发者ID:winch,项目名称:winch.pinkbile.com-c-sharp,代码行数:56,代码来源:search.cs

示例2: BuildList

	public static void BuildList(string darkBasic, CheckedListBox ca, CheckedListBox cb, ListView lv, ArrayList al)
	{
		Cursor.Current = Cursors.WaitCursor;
		int s;
		string[] items;
		lv.BeginUpdate();
		lv.Items.Clear();
		StringBuilder sb = new StringBuilder(255);
		foreach (object ob in ca.Items)
		{
			string str = darkBasic + "plugins\\" + ob.ToString();
			uint hinst = Build.LoadLibrary(str);
			s = 1;
			int bad = 0;
			while (bad < 5)
			{
				if (Build.LoadString(hinst, s, sb, 255) > 0)
				{
					ListViewItem lvi = new ListViewItem();
					items = sb.ToString().Split("%".ToCharArray(), 2);
					lvi.Text = items[0];
					lvi.SubItems.Add(ob.ToString());
					lv.Items.Add(lvi);
					//add item to arraylist
					Search se = new Search(lvi.Text, lvi.SubItems[1].Text);
					al.Add(se);
				}
				else
				{
					bad ++;
				}
				s ++;
			}
			Build.FreeLibrary(hinst);
		}
		foreach (object ob in cb.Items)
		{
			string str = darkBasic + "plugins-user\\" + ob.ToString();
			uint hinst = Build.LoadLibrary(str);
			s = 1;
			int bad = 0;
			while (bad < 5)
			{
				if (Build.LoadString(hinst, s, sb, 255) > 0)
				{
					ListViewItem lvi = new ListViewItem();
					items = sb.ToString().Split("%".ToCharArray(), 2);
					lvi.Text = items[0];
					lvi.SubItems.Add(ob.ToString());
					lv.Items.Add(lvi);
					//add item to arraylist
					Search se = new Search(lvi.Text, lvi.SubItems[1].Text);
					al.Add(se);
				}
				else
				{
					bad ++;
				}
				s ++;
			}
			Build.FreeLibrary(hinst);
		}
		lv.EndUpdate();
		Cursor.Current = Cursors.Default;
	}
开发者ID:winch,项目名称:winch.pinkbile.com-c-sharp,代码行数:65,代码来源:search.cs

示例3: InitandFillListView

        /// <summary>
        /// Initialize and populate a listview.
        /// </summary>
        /// <param name="value"> </param>
        public void InitandFillListView(ListView value)
        {
            int colsize = (value.Width - 6) / 3;

            value.BeginUpdate();

            value.Columns.Clear();
            value.ListItems.Clear();

            value.View = System.WinForms.View.Report;
            value.CheckBoxes = showChecks;
            value.Columns.Add("File Name", colsize, HorizontalAlignment.Left);
            value.Columns.Add("Size (Bytes)", colsize, HorizontalAlignment.Right);
            value.Columns.Add("Path", colsize, HorizontalAlignment.Left);

            FillListView(value);

            value.EndUpdate();
        }
开发者ID:hyuntaeng,项目名称:StarUML,代码行数:23,代码来源:sample9.cs


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