本文整理汇总了C#中Folder.FullName方法的典型用法代码示例。如果您正苦于以下问题:C# Folder.FullName方法的具体用法?C# Folder.FullName怎么用?C# Folder.FullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder.FullName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteFolder
/// <summary>
/// Deletes a folder from the Project, and possibly from the filesystem also.
/// </summary>
/// <param name="folder">The folder to Delete</param>
public void DeleteFolder(Folder folder)
{
DialogResult msgRes =
Util.ShowQuestion(
"Do you want to remove the physical folder from the hard drive?\nYes: Remove both Project Reference and Physical Folder\nNo: Remove Project Reference and leave Physical Folder\nCancel: Cancel File Operation");
if (msgRes == DialogResult.Yes)
{
// Remove the TreeNode
folder.Node.Remove();
// Remove physical file
Directory.Delete(folder.FullName(), true);
// Remove the project reference
if (folder.Parent == null)
// Remove from Project
Project.Folders.Remove(folder);
else
// Remove from the parent folder
folder.Parent.Folders.Remove(folder);
}
else if (msgRes == DialogResult.No)
{
folder.Node.Remove();
// Remove just the project reference
if (folder.Parent == null)
// Remove from Project
Project.Folders.Remove(folder);
else
// Remove from the parent folder
folder.Parent.Folders.Remove(folder);
}
}