當前位置: 首頁>>代碼示例>>C#>>正文


C# FilePath.GetAbsoluteFile方法代碼示例

本文整理匯總了C#中Sharpen.FilePath.GetAbsoluteFile方法的典型用法代碼示例。如果您正苦於以下問題:C# FilePath.GetAbsoluteFile方法的具體用法?C# FilePath.GetAbsoluteFile怎麽用?C# FilePath.GetAbsoluteFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sharpen.FilePath的用法示例。


在下文中一共展示了FilePath.GetAbsoluteFile方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Canonical

			private static FilePath Canonical(FilePath path)
			{
				try
				{
					return path.GetCanonicalFile();
				}
				catch (IOException)
				{
					return path.GetAbsoluteFile();
				}
			}
開發者ID:LunarLanding,項目名稱:ngit,代碼行數:11,代碼來源:RepositoryCache.cs

示例2: Test30_stripWorkDir

 public virtual void Test30_stripWorkDir()
 {
     FilePath relCwd = new FilePath(".");
     FilePath absCwd = relCwd.GetAbsoluteFile();
     FilePath absBase = new FilePath(new FilePath(absCwd, "repo"), "workdir");
     FilePath relBase = new FilePath(new FilePath(relCwd, "repo"), "workdir");
     NUnit.Framework.Assert.AreEqual(absBase.GetAbsolutePath(), relBase.GetAbsolutePath
         ());
     FilePath relBaseFile = new FilePath(new FilePath(relBase, "other"), "module.c");
     FilePath absBaseFile = new FilePath(new FilePath(absBase, "other"), "module.c");
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(relBase
         , relBaseFile));
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(relBase
         , absBaseFile));
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(absBase
         , relBaseFile));
     NUnit.Framework.Assert.AreEqual("other/module.c", Repository.StripWorkDir(absBase
         , absBaseFile));
     FilePath relNonFile = new FilePath(new FilePath(relCwd, "not-repo"), ".gitignore"
         );
     FilePath absNonFile = new FilePath(new FilePath(absCwd, "not-repo"), ".gitignore"
         );
     NUnit.Framework.Assert.AreEqual(string.Empty, Repository.StripWorkDir(relBase, relNonFile
         ));
     NUnit.Framework.Assert.AreEqual(string.Empty, Repository.StripWorkDir(absBase, absNonFile
         ));
     NUnit.Framework.Assert.AreEqual(string.Empty, Repository.StripWorkDir(db.WorkTree
         , db.WorkTree));
     FilePath file = new FilePath(new FilePath(db.WorkTree, "subdir"), "File.java");
     NUnit.Framework.Assert.AreEqual("subdir/File.java", Repository.StripWorkDir(db.WorkTree
         , file));
 }
開發者ID:JamesChan,項目名稱:ngit,代碼行數:32,代碼來源:T0003_BasicTest.cs

示例3: CreateRequire

		/// <exception cref="Sharpen.URISyntaxException"></exception>
		private static Require CreateRequire(FilePath dir, Context cx, Scriptable scope)
		{
			return new Require(cx, scope, new StrongCachingModuleScriptProvider(new UrlModuleSourceProvider(Collections.Singleton(dir.GetAbsoluteFile().ToURI()), Collections.Singleton(new Uri(typeof(ComplianceTest).GetResource(".").ToExternalForm() + "/")))), null, null, false);
		}
開發者ID:hazzik,項目名稱:Rhino.Net,代碼行數:5,代碼來源:ComplianceTest.cs


注:本文中的Sharpen.FilePath.GetAbsoluteFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。