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


C# Resource.getPath方法代码示例

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


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

示例1: createInputStream

        public InputStream createInputStream(Resource resource)
        {
            var fullyQualifiedTypeName = this.ConvertPathToNamespace(resource.getPath());

            if (canFind(resource))
            {
                var manifestResourceStream = this.FixtureAssembly.GetManifestResourceStream(fullyQualifiedTypeName);
                return new InputStreamWrapper(manifestResourceStream);
            }

            throw new InvalidOperationException(string.Format("Cannot open the resource {0}", fullyQualifiedTypeName));
        }
开发者ID:concordion,项目名称:concordion.net,代码行数:12,代码来源:EmbeddedResourceSource.cs

示例2: ExistingFilePath

 private string ExistingFilePath(Resource resource)
 {
     var resourcePath = resource.getPath().Replace("/", "\\");
     if (resourcePath.StartsWith("\\"))
     {
         resourcePath = resourcePath.Substring(1);
     }
     var filePath = Path.Combine(BaseDirectory, resourcePath);
     if (File.Exists(filePath))
     {
         return filePath;
     }
     filePath = Path.Combine(BaseDirectory, 
         this.RemoveFirst(resourcePath, FixtureAssembly.GetName().Name.Replace('.', PathSeparator) + PathSeparator));
     if (File.Exists(filePath))
     {
         return filePath;
     }
     return null;
 }
开发者ID:concordion,项目名称:concordion.net,代码行数:20,代码来源:FileSource.cs

示例3: createInputStream

 public InputStream createInputStream(Resource resource)
 {
     Check.isTrue(canFind(resource), "No such resource exists in simulator: " + resource.getPath());
     return new ByteArrayInputStream(Encoding.UTF8.GetBytes(this.resources[resource]));
 }
开发者ID:concordion,项目名称:concordion.net,代码行数:5,代码来源:StubSource.cs

示例4: GetWrittenString

 public string GetWrittenString(Resource resource)
 {
     Check.isTrue(this.writtenStrings.ContainsKey(resource), "Expected resource '" + resource.getPath() + "' was not written to target");
     return this.writtenStrings[resource];
 }
开发者ID:concordion,项目名称:concordion.net,代码行数:5,代码来源:StubTarget.cs

示例5: canFind

 public bool canFind(Resource resource)
 {
     var fullyQualifiedTypeName = this.ConvertPathToNamespace(resource.getPath());
     return this.FixtureAssembly.GetManifestResourceInfo(fullyQualifiedTypeName) != null;
 }
开发者ID:concordion,项目名称:concordion.net,代码行数:5,代码来源:EmbeddedResourceSource.cs

示例6: GetTargetPath

 private string GetTargetPath(Resource resource)
 {
     return Path.Combine(this.BaseDirectory, RelavitePath(resource.getPath()));
 }
开发者ID:concordion,项目名称:concordion.net,代码行数:4,代码来源:FileTarget.cs

示例7: delete

 public void delete(Resource resource)
 {
     Check.notNull(resource, "resource is null");
     File.Delete(this.BaseDirectory + resource.getPath());
 }
开发者ID:concordion,项目名称:concordion.net,代码行数:5,代码来源:FileTarget.cs


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