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


C# FileSystem.PersistToFile方法代码示例

本文整理汇总了C#中System.IO.FileSystem.PersistToFile方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.PersistToFile方法的具体用法?C# FileSystem.PersistToFile怎么用?C# FileSystem.PersistToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.FileSystem的用法示例。


在下文中一共展示了FileSystem.PersistToFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveResult

        public static void SaveResult(TestResult result, Test test, string folder)
        {
            result.Locator = test.GetPath().Locator;

            var fileSystem = new FileSystem();
            fileSystem.CreateDirectory(folder);

            var filename = Path.Combine(folder, FileNameFor(test));

            fileSystem.PersistToFile(result, filename);
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:11,代码来源:ResultPersistor.cs

示例2: SaveResultsToDirectory

        public void SaveResultsToDirectory(ResultHistory theResults, string directory)
        {
            var system = new FileSystem();
            system.ClearFolder(directory);

            theResults.Each((path, result) =>
            {
                result.Locator = path;
                string filename = FileNameFor(path);
                filename = Path.Combine(directory, filename);
                system.PersistToFile(result, filename);
            });
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:13,代码来源:ResultPersistor.cs

示例3: SetUp

        public void SetUp()
        {
            packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath();

            var fileSystem = new FileSystem();
            var manifest = new PackageManifest(){
                Assemblies = "TestPackage1",
                Name = "pak1"
            };

            fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE);

            reader = new PackageManifestReader("../../".ToFullPath(), fileSystem);
        }
开发者ID:sbartlett,项目名称:fubumvc,代码行数:14,代码来源:PackageManifestReaderIntegratedTester.cs

示例4: SetUp

        public void SetUp()
        {
            packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath();

            var fileSystem = new FileSystem();
            var manifest = new PackageManifest{
                Name = "pak1"
            };

            manifest.AddAssembly("TestPackage1");

            fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE);

            linkedFolderReader = new LinkedFolderPackageLoader(theApplicationDirectory, f => f);

            reader = new BottleManifestReader(fileSystem, folder => folder);
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:17,代码来源:PackageManifestReaderIntegratedTester.cs

示例5: save_and_load_an_object_to_xml

        public void save_and_load_an_object_to_xml()
        {
            var object1 = new BigObject
            {
                Name = "Max",
                Age = 5
            };
            var system = new FileSystem();
            system.PersistToFile(object1, "bigobject.xml");

            var object2 = system.LoadFromFile<BigObject>("bigobject.xml");

            object1.ShouldNotBeTheSameAs(object2);
            object1.ShouldEqual(object2);
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:15,代码来源:FileSystemTester.cs


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