当前位置: 首页>>代码示例>>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;未经允许,请勿转载。