Пример #1
0
        public static PhysicalFileSource For(FileInfo file, ResourceType resourceType, Mode mode)
        {
            var virtualPathFor = VirtualPathResolver.GetVirtualPathFor(file);

            var physicalFileSource = For(virtualPathFor);

            if (physicalFileSource == null)
            {
                physicalFileSource = new PhysicalFileSource(resourceType,
                                                            virtualPathFor,
                                                            file.FullName,
                                                            mode);

                Set(physicalFileSource);
            }

            return physicalFileSource;
        }
Пример #2
0
        public static PhysicalFileSource For(string virtualPath, ResourceType resourceType, Mode mode)
        {
            var file = new FileInfo(VirtualPathResolver.ResolveVirtualPath(virtualPath));

            var physicalFileSource = For(virtualPath);

            if (physicalFileSource == null)
            {
                physicalFileSource = new PhysicalFileSource(resourceType,
                                                            virtualPath,
                                                            file.FullName,
                                                            mode);

                Set(physicalFileSource);
            }

            return physicalFileSource;
        }
Пример #3
0
 public static void Set(PhysicalFileSource fileSource)
 {
     fileSourceRegister[fileSource.VirtualPath] = fileSource;
 }