當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。