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


C# TemporaryFolder.GetPathForNewTempFile方法代码示例

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


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

示例1: NewEntry_ByEntry_TriggersModifiedEntryAdded

		public void NewEntry_ByEntry_TriggersModifiedEntryAdded()
		{
			using (var f = new TemporaryFolder("eventTests"))
			{
				using (var r = new LiftLexEntryRepository(f.GetPathForNewTempFile(true)))
				{
					r.AfterEntryModified += OnEvent;
					LexEntry entry = r.CreateItem();
					r.SaveItem(entry);
					Assert.IsTrue(_gotEventCall);
				}
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:13,代码来源:LexEntryRepositoryEventTests.cs

示例2: DeleteEntry_ByEntry_TriggersAfterEntryDeleted

		public void DeleteEntry_ByEntry_TriggersAfterEntryDeleted()
		{
			using (TemporaryFolder f = new TemporaryFolder("eventTests"))
			{
				using (LiftLexEntryRepository r = new LiftLexEntryRepository(f.GetPathForNewTempFile(true)))
				{
					r.AfterEntryDeleted += OnEvent;

					LexEntry entry = r.CreateItem();
					r.SaveItem(entry);

					r.DeleteItem(entry);
					Assert.IsTrue(_gotEventCall);
				}
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:16,代码来源:LexEntryRepositoryEventTests.cs

示例3: TempLiftFile

		public TempLiftFile(TemporaryFolder parentFolder, string xmlOfEntries, string claimedLiftVersion)
			: base(true) // True means "I'll set the the pathname, thank you very much." Otherwise, the temp one 'false' creates will stay forever, and fill the hard drive up.
		{
			if (parentFolder != null)
			{
				_path = parentFolder.GetPathForNewTempFile(false) + ".lift";
			}
			else
			{
				var temp = System.IO.Path.GetTempFileName();
				_path = temp + ".lift";
				File.Move(temp, _path);
			}

			string liftContents = string.Format("<?xml version='1.0' encoding='utf-8'?><lift version='{0}'>{1}</lift>", claimedLiftVersion, xmlOfEntries);
			File.WriteAllText(_path, liftContents);
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:17,代码来源:TemporaryFolder.cs

示例4: TempFileFromFolder

		/// <summary>
		/// Create a tempfile within the given parent folder
		/// </summary>
		public TempFileFromFolder(TemporaryFolder parentFolder)
			: base(true) // True means "I'll set the the pathname, thank you very much." Otherwise, the temp one 'false' creates will stay forever, and fill the hard drive up.
		{
			_path = parentFolder != null ? parentFolder.GetPathForNewTempFile(true) : System.IO.Path.GetTempFileName();
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:8,代码来源:TemporaryFolder.cs


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