本文整理汇总了C#中Manifest.ListPaths方法的典型用法代码示例。如果您正苦于以下问题:C# Manifest.ListPaths方法的具体用法?C# Manifest.ListPaths怎么用?C# Manifest.ListPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manifest
的用法示例。
在下文中一共展示了Manifest.ListPaths方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DirectoryOperation
/// <summary>
/// Creates a new manifest directory task.
/// </summary>
/// <param name="path">The path of the directory to operate on.</param>
/// <param name="manifest">The contents of a <see cref="Implementations.Manifest"/> file describing the directory.</param>
/// <param name="handler">A callback object used when the the user needs to be asked questions or informed about IO tasks.</param>
protected DirectoryOperation([NotNull] string path, [NotNull] Manifest manifest, [NotNull] ITaskHandler handler)
{
#region Sanity checks
if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
if (manifest == null) throw new ArgumentNullException(nameof(manifest));
if (handler == null) throw new ArgumentNullException(nameof(handler));
#endregion
Path = path;
Manifest = manifest;
Handler = handler;
ElementPaths = Manifest.ListPaths();
}
示例2: TestListPaths
public void TestListPaths()
{
var normalFile = new ManifestNormalFile("123", new DateTime(), 10, "normal");
var dir1 = new ManifestDirectory("/dir1");
var executableFile = new ManifestExecutableFile("123", new DateTime(), 10, "executable");
var dir2 = new ManifestDirectory("/dir2");
var symlink = new ManifestSymlink("123", 10, "symlink");
var manifest = new Manifest(ManifestFormat.Sha256New, normalFile, dir1, executableFile, dir2, symlink);
manifest.ListPaths().Should().Equal(
new KeyValuePair<string, ManifestNode>("normal", normalFile),
new KeyValuePair<string, ManifestNode>("dir1", dir1),
new KeyValuePair<string, ManifestNode>(Path.Combine("dir1", "executable"), executableFile),
new KeyValuePair<string, ManifestNode>("dir2", dir2),
new KeyValuePair<string, ManifestNode>(Path.Combine("dir2", "symlink"), symlink));
}