本文整理匯總了C#中ShellDll.ShellItem.Expand方法的典型用法代碼示例。如果您正苦於以下問題:C# ShellItem.Expand方法的具體用法?C# ShellItem.Expand怎麽用?C# ShellItem.Expand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShellDll.ShellItem
的用法示例。
在下文中一共展示了ShellItem.Expand方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetNewPath
/// <summary>
/// When a new directory is selected, this method is called to clear the ListView and fill it with
/// the contents of the new directory
/// </summary>
/// <param name="oldItem">The ShellItem of the previous selected directory</param>
/// <param name="newItem">The ShellItem of the new selected directory</param>
private bool SetNewPath(ShellItem oldItem, ShellItem newItem)
{
Cursor.Current = Cursors.WaitCursor;
if (oldItem != newItem && newItem.Expand(true, false, Handle))
{
ShellBrowser.UpdateCondition.ContinueUpdate = false;
fileView.BeginUpdate();
fileView.Items.Clear();
fileView.ClearSelections();
if (oldItem != null)
{
bool used = false;
foreach (Browser br in ShellBrowser.Browsers)
{
if (!this.Equals(br) && oldItem.Equals(br.SelectedItem))
{
used = true;
break;
}
}
if (!used)
oldItem.Clear(true, false);
}
selectedItem = newItem;
ListViewItem[] newListItemsArray = new ListViewItem[newItem.Count];
string[] subItems = new string[fileView.Columns.Count - 1];
for (int i = 0; i < newListItemsArray.Length; i++)
{
newListItemsArray[i] = GetListViewItem(subItems, newItem[i]);
}
fileView.SetSorting(true);
fileView.Items.AddRange(newListItemsArray);
fileView.SetSorting(false);
fileView.EndUpdate();
Cursor.Current = Cursors.Default;
return true;
}
else
{
Cursor.Current = Cursors.Default;
return (oldItem == newItem);
}
}