当前位置: 首页>>代码示例>>C#>>正文


C# Manifest.ListPaths方法代码示例

本文整理汇总了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();
        }
开发者ID:0install,项目名称:0install-win,代码行数:20,代码来源:DirectoryOperation.cs

示例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));
        }
开发者ID:0install,项目名称:0install-win,代码行数:16,代码来源:ManifestTest.cs


注:本文中的Manifest.ListPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。