本文整理匯總了C#中System.Local.DirectoryExists方法的典型用法代碼示例。如果您正苦於以下問題:C# Local.DirectoryExists方法的具體用法?C# Local.DirectoryExists怎麽用?C# Local.DirectoryExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Local
的用法示例。
在下文中一共展示了Local.DirectoryExists方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddOrUpdateItem
public void AddOrUpdateItem(Local.SniffDirectory sniffDirectory)
{
if (this.InvokeRequired)
{
this.Invoke(new DelegateManager.DelegateAddOrUpdateItem<Local.SniffDirectory>(AddOrUpdateItem), sniffDirectory);
}
else
{
lstView.BeginUpdate();
var key = sniffDirectory.Directory;
ListViewItem listviewitem = null;
if (!lstView.Items.ContainsKey(key))
{
listviewitem = lstView.Items.Add(key, sniffDirectory.Directory, 0);
listviewitem.SubItems.Add(sniffDirectory.SearchPattern);
listviewitem.SubItems.Add(sniffDirectory.Recursive.BoolValueYesNo());
listviewitem.SubItems.Add(sniffDirectory.GetFiles().Count.ToString());
}
else
{
listviewitem = lstView.Items[key];
listviewitem.SubItems[0].Text = sniffDirectory.Directory;
listviewitem.SubItems[1].Text = sniffDirectory.SearchPattern;
listviewitem.SubItems[2].Text = sniffDirectory.Recursive.BoolValueYesNo();
listviewitem.SubItems[3].Text = sniffDirectory.GetFiles().Count.ToString();
}
listviewitem.Checked = sniffDirectory.Include;
listviewitem.Tag = (Guid?)sniffDirectory.DataObjectGUID;
if (sniffDirectory.Include)
{
listviewitem.BackColor = !sniffDirectory.DirectoryExists() ? Color.Salmon : Color.LightGreen;
listviewitem.ForeColor = SystemColors.ControlText;
}
else
{
listviewitem.BackColor = Color.White;
listviewitem.ForeColor = Color.LightGray;
}
lstView.EndUpdate();
}
}