本文整理汇总了C#中ListView.BeginUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.BeginUpdate方法的具体用法?C# ListView.BeginUpdate怎么用?C# ListView.BeginUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListView
的用法示例。
在下文中一共展示了ListView.BeginUpdate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main (string [] args)
{
ListView entryList = new ListView ();
entryList.Sorting = System.Windows.Forms.SortOrder.Descending;
entryList.BeginUpdate ();
entryList.Columns.Add ("Type", 100, HorizontalAlignment.Left);
ListViewItem item = new ListViewItem (new string [] { "A" });
entryList.Items.Add (item);
item = new ListViewItem (new string [] { "B" });
entryList.Items.Add (item);
}
示例2: 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();
}
示例3: 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;
}
示例4: 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;
}