• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# VirtualPath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中VirtualPath的典型用法代码示例。如果您正苦于以下问题:C# VirtualPath类的具体用法?C# VirtualPath怎么用?C# VirtualPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VirtualPath类属于命名空间,在下文中一共展示了VirtualPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Create

    // Create a PageParserFilter and initialize it
    internal static PageParserFilter Create(PagesSection pagesConfig, VirtualPath virtualPath, TemplateParser parser) {
        PageParserFilter pageParserFilter = pagesConfig.CreateControlTypeFilter();
        if (pageParserFilter != null)
            pageParserFilter.InitializeInternal(virtualPath, parser);

        return pageParserFilter;
    }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:PageParserFilter.cs


示例2: VirtualDirectoryMapping

        private VirtualDirectoryMapping(VirtualPath virtualDirectory, string physicalDirectory, bool isAppRoot, string configFileBaseName) {
            _virtualDirectory = virtualDirectory;
            _isAppRoot = isAppRoot;

            PhysicalDirectory = physicalDirectory;
            ConfigFileBaseName = configFileBaseName;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:VirtualDirectoryMapping.cs


示例3: PageThemeBuildProvider

    internal PageThemeBuildProvider(VirtualPath virtualDirPath) {
        _virtualDirPath = virtualDirPath;

        // 

        SetVirtualPath(virtualDirPath);
    }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:PageThemeBuildProvider.cs


示例4: GetView

        public IView GetView(VirtualPath path)
        {
            if (path.Parts.Count == 0) return null;
            var filename = "../" + path.Parts.Last();

            var candidatePaths = new VirtualPath[] { path }
                .Concat(
                    from ext in _registry.GetRegisteredExtensions()
                    select path.Append(filename + "." + ext)
                );

            var infos =
                from c in candidatePaths
                let info = _registry.GetViewInfo(path)
                let resource = info.Location(info.RelativePath, _serviceLocator)
                where resource != null && resource.IsFile
                select new {
                    Path = c,
                    Resource = resource
                };

            var viewInfo = infos.FirstOrDefault();
            if (viewInfo == null) return null;

            var resourceResolver = new ViewResourceResolver(_registry, _serviceLocator, viewInfo.Resource);
            var extension = viewInfo.Path.Parts.Last().Split('.').Last();
            var viewEngine = _registry.GetViewEngine(extension);
            return viewEngine.GetView(viewInfo.Path, resourceResolver);
        }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:29,代码来源:ViewResolver.cs


示例5: ReadBuildResultFromFile

    internal BuildResult ReadBuildResultFromFile(VirtualPath virtualPath, string preservationFile, long hashCode, bool ensureIsUpToDate) {

        // Ignore if the preservation file doesn't exist
        if (!FileUtil.FileExists(preservationFile)) {
            Debug.Trace("PreservationFileReader", "Can't find preservation file " + Path.GetFileName(preservationFile));
            return null;
        }

        BuildResult result = null;
        try {
            result = ReadFileInternal(virtualPath, preservationFile, hashCode, ensureIsUpToDate);
        }
        catch (SecurityException) {
            // We eat all exceptions, except for SecurityException's, because they
            // are ususally a sign that something is not set up correctly, and we
            // don't want to lose the stack (VSWhidbey 269566)
            throw;
        }
        catch {
            if (!_precompilationMode) {
                // The preservation file can't be used, so get rid of it
                Util.RemoveOrRenameFile(preservationFile);
            }
        }

        return result;
    }
开发者ID:uQr,项目名称:referencesource,代码行数:27,代码来源:PreservationFileReader.cs


示例6: NTFSDirectory

 public NTFSDirectory(NTFSFileSystemProvider fileSystemProvider, string name, VirtualPath path)
 {
     this.fileSystemProvider = fileSystemProvider;
     Name = name;
     if (path.IsRoot)
         Name = string.Empty;
     Path = path;
 }
开发者ID:jdaigle,项目名称:Centro,代码行数:8,代码来源:NTFSDirectory.cs


示例7: InvalidOperationException

 // if appHost is null, we use the site name for the current application
 string IServerConfig.MapPath(IApplicationHost appHost, VirtualPath path) {
     string siteName = (appHost == null) ? _siteNameForCurrentApplication : appHost.GetSiteName();
     string physicalPath = ProcessHostConfigUtils.MapPathActual(siteName, path);
     if (FileUtil.IsSuspiciousPhysicalPath(physicalPath)) {
         throw new InvalidOperationException(SR.GetString(SR.Cannot_map_path, path.VirtualPathString));
     }
     return physicalPath;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:9,代码来源:ProcessHostServerConfig.cs


示例8: ResourceMapping

 public ResourceMapping(VirtualPath root, IResourceLocation location)
 {
     if (root.Type != VirtualPathType.AppRelative) {
         throw new ArgumentException("The root path must be app-relative.");
     }
     Root = root;
     Location = location;
 }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:8,代码来源:ResourceMapping.cs


示例9: MapPath

		protected override string MapPath (VirtualPath virtualPath)
		{
			// We need this hack to support out-of-application wsdl helpers
			if (virtualPath.IsFake)
				return virtualPath.PhysicalPath;

			return base.MapPath (virtualPath);
		}               
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:PageBuildProvider.cs


示例10: BuildProvidersCompiler

 internal BuildProvidersCompiler(VirtualPath configPath, bool supportLocalization, 
     string outputAssemblyName) {
     _configPath = configPath;
     _supportLocalization = supportLocalization;
     _compConfig = MTConfigUtil.GetCompilationConfig(_configPath);
     _referencedAssemblies = BuildManager.GetReferencedAssemblies(CompConfig);
     _outputAssemblyName = outputAssemblyName;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:BuildProvidersCompiler.cs


示例11: AddDependency

    protected void AddDependency(VirtualPath virtualPath) {
        virtualPath = ResolveVirtualPath(virtualPath);
        Debug.Trace("Template", "Parsed dependency: " + _virtualPath + " depends on " + virtualPath);

        if (_virtualPathDependencies == null)
            _virtualPathDependencies = new CaseInsensitiveStringSet();

        _virtualPathDependencies.Add(virtualPath.VirtualPathString);
    }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:9,代码来源:BatchParser.cs


示例12: CodeBlockBuilder

    internal CodeBlockBuilder(CodeBlockType blockType, string content, int lineNumber, int column, VirtualPath virtualPath, bool encode) {
        _content = content;
        _blockType = blockType;
        _column = column;
        IsEncoded = encode;

        Line = lineNumber;
        VirtualPath = virtualPath;
    }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:9,代码来源:CodeBlockBuilder.cs


示例13: CreateView

        protected override IView CreateView(VirtualPath pathToView, IResourceResolver resolver)
        {
            var resource = resolver.GetResource(pathToView);
            if (resource == null || !resource.IsFile) {
                return null;
            }

            return new NustacheView(this, pathToView, resource, resolver);
        }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:9,代码来源:NustacheViewEngine.cs


示例14: GetChildTemplate

 private Template GetChildTemplate(string path)
 {
     var newPath = new VirtualPath(path);
     if (newPath.Type != VirtualPathType.AppRelative) {
         throw new NotSupportedException("The Nustache view engine only supports app-relative paths at present.");
     }
     var result = _engine.GetView(newPath, _resolver) as NustacheView;
     if (result == null) return null;
     return result.Template;
 }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:10,代码来源:NustacheView.cs


示例15: DotLiquidView

 public DotLiquidView(VirtualPath path, IResource resource, IResourceResolver resolver)
 {
     _path = path;
     _resolver = resolver;
     using (var stream = resource.Open())
     using (var reader = new StreamReader(stream)) {
         string tpl = reader.ReadToEnd();
         _template = Template.Parse(tpl);
     }
 }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:10,代码来源:DotLiquidView.cs


示例16: SpecialOpenReader

		protected override TextReader SpecialOpenReader (VirtualPath virtualPath, out string physicalPath)
		{
			// We need this hack to support out-of-application wsdl helpers
			if (virtualPath.IsFake) {
				physicalPath = virtualPath.PhysicalPath;
				return new StreamReader (physicalPath);
			} else
				physicalPath = null;
			
			return base.SpecialOpenReader (virtualPath, out physicalPath);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:PageBuildProvider.cs


示例17: NustacheView

 public NustacheView(NustacheViewEngine engine, VirtualPath path, IResource resource, IResourceResolver resolver)
 {
     _engine = engine;
     _path = path;
     _resolver = resolver;
     using (var stream = resource.Open())
     using (var reader = new StreamReader(stream)) {
         Template = new Template();
         Template.Load(reader);
     }
 }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:11,代码来源:NustacheView.cs


示例18: GetHandler

    IHttpHandler IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType,
        VirtualPath virtualPath, String physicalPath) {

        // If it's a derived class, we must call the old (less efficient) GetHandler, in
        // case it was overriden
        if (_isInheritedInstance) {
            return GetHandler(context, requestType, virtualPath.VirtualPathString, physicalPath);
        }

        return GetHandlerHelper(context, requestType, virtualPath, physicalPath);
    }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:11,代码来源:PageHandlerFactory.cs


示例19: GetResource

        public IResource GetResource(VirtualPath path)
        {
            var resourceName = String.Join(".",
                new[] { RootNamespace }.Concat(path.Parts)
            );
            var name = this.Assembly.GetManifestResourceNames().FirstOrDefault
                (x => x.Equals(resourceName, StringComparison.OrdinalIgnoreCase));
            if (name == null) return null;

            return new AssemblyResource(this.Assembly, name);
        }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:11,代码来源:AssemblyResourceLocation.cs


示例20: GetResource

 public IResource GetResource(VirtualPath path)
 {
     var parts = new string[] { Root }.Concat(path.Parts).ToArray();
     var physicalPath = Path.Combine(parts);
     if (File.Exists(physicalPath)) {
         return new FileResource(physicalPath);
     }
     else {
         return null;
     }
 }
开发者ID:jammycakes,项目名称:dolstagis.web,代码行数:11,代码来源:FileResourceLocation.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VirtualSnapshotPoint类代码示例发布时间:2022-05-24
下一篇:
C# VirtualMachine类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap