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


C# VirtualPath类代码示例

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


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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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