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

C# IVirtualDirectory类代码示例

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

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



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

示例1: setup

        public void setup()
        {
            _provider = new DirectoryVirtualFileProvider();
            _root = MockRepository.GenerateMock<IVirtualDirectory>();

            _provider.Setup(_root);
        }
开发者ID:Epibatidin,项目名称:FLUX,代码行数:7,代码来源:DirectoryVirtualFileProviderTests.cs


示例2: InMemoryVirtualDirectory

 public InMemoryVirtualDirectory(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory)
     : base(owningProvider, parentDirectory)
 {
     this.files = new List<InMemoryVirtualFile>();
     this.dirs = new List<InMemoryVirtualDirectory>();
     this.DirLastModified = DateTime.MinValue;
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:7,代码来源:InMemoryVirtualPathProvider.cs


示例3: AzureBlobVirtualFile

        public AzureBlobVirtualFile(AzureBlobVirtualPathProvider owningProvider, IVirtualDirectory directory)
            : base(owningProvider, directory)
        {
            this.pathProvider = owningProvider;
            this.container = pathProvider.Container;

        }
开发者ID:jklemmack,项目名称:ServiceStack.Azure,代码行数:7,代码来源:AzureBlobVirtualFile.cs


示例4: GetTemplatePath

        public string GetTemplatePath(IVirtualDirectory fileDir)
        {
            try
            {
                if (templatePathsNotFound.Contains(fileDir.VirtualPath)) return null;

                var templateDir = fileDir;
                IVirtualFile templateFile;
                while (templateDir != null && templateDir.GetFile(defaultTemplateName) == null)
                {
                    if (templatePathsFound.TryGetValue(templateDir.VirtualPath, out templateFile))
                        return templateFile.RealPath;

                    templateDir = templateDir.ParentDirectory;
                }

                if (templateDir != null)
                {
                    templateFile = templateDir.GetFile(defaultTemplateName);
                    templatePathsFound[templateDir.VirtualPath] = templateFile;
                    return templateFile.VirtualPath;
                }

                templatePathsNotFound.Add(fileDir.VirtualPath);
                return null;

            }
            catch (Exception ex)
            {
                ex.Message.Print();
                throw;
            }
        }
开发者ID:erewh0n,项目名称:ServiceStack,代码行数:33,代码来源:TemplateProvider.cs


示例5: FileSystemVirtualDirectory

        public FileSystemVirtualDirectory(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory, DirectoryInfo dInfo)
            : base(owningProvider, parentDirectory)
        {
            if (dInfo == null)
                throw new ArgumentNullException("dInfo");

            this.BackingDirInfo = dInfo;
        }
开发者ID:JonCanning,项目名称:ServiceStack,代码行数:8,代码来源:FileSystemVirtualDirectory.cs


示例6: AbstractVirtualDirectoryBase

        protected AbstractVirtualDirectoryBase(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory)
        {
            if (owningProvider == null)
                throw new ArgumentNullException("owningProvider");

            this.VirtualPathProvider = owningProvider;
            this.ParentDirectory = parentDirectory;
        }
开发者ID:GDBSD,项目名称:ServiceStack,代码行数:8,代码来源:AbstractVirtualDirectoryBase.cs


示例7: FileSystemVirtualFile

        public FileSystemVirtualFile(IVirtualPathProvider owningProvider, IVirtualDirectory directory, FileInfo fInfo) 
            : base(owningProvider, directory)
        {
            if (fInfo == null)
                throw new ArgumentNullException("fInfo");

            this.BackingFile = fInfo;
        }
开发者ID:JonCanning,项目名称:ServiceStack,代码行数:8,代码来源:FileSystemVirtualFile.cs


示例8: SftpVirtualFile

 public SftpVirtualFile(SftpVirtualPathProvider owningProvider, IVirtualDirectory directory, string name, DateTime? lastModified)
     : base(owningProvider, directory)
 {
     this.Provider = owningProvider;
     this._name = name;
     this._lastModified = lastModified ?? DateTime.MinValue;
     this.File = new Lazy<SftpFile>(() => _file ?? Provider.GetSftpFile(this.VirtualPath));
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:8,代码来源:SftpVirtualFile.cs


示例9: SftpVirtualDirectory

 public SftpVirtualDirectory(SftpVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory, 
     String name = null, DateTime? lastModified = null)
     : base(owningProvider, parentDirectory)
 {
     this.Provider = owningProvider;
     _name = name;
     _lastModified = lastModified ?? DateTime.MinValue;
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:8,代码来源:SftpVirtualDirectory.cs


示例10: ResourceVirtualDirectory

 public ResourceVirtualDirectory(IVirtualPathProvider owningProvider, 
     IVirtualDirectory parentDir, 
     Assembly backingAsm, 
     string rootNamespace)
 : this(owningProvider, 
     parentDir, 
     backingAsm, 
     rootNamespace,
     rootNamespace, 
     GetResourceNames(backingAsm, rootNamespace)) { }
开发者ID:CLupica,项目名称:ServiceStack,代码行数:10,代码来源:ResourceVirtualDirectory.cs


示例11: getCounts

        private int[] getCounts(IVirtualDirectory subroot, int[] subRoots)
        {
            var index = subroot.GetFile("Index.xml");
            XmlSerializer ser = new XmlSerializer(typeof(Root));
            var o = ser.Deserialize(index.Open());
            var root =  o as Root;

            if (subRoots == null || subRoots.Length == 0)
                subRoots = Enumerable.Range(0, root.Groups).ToArray();

            return subRoots;
        }
开发者ID:Epibatidin,项目名称:FLUX,代码行数:12,代码来源:XMLVirtualFileProvider.cs


示例12: AbstractVirtualFileBase

        protected AbstractVirtualFileBase(
            IVirtualPathProvider owningProvider, IVirtualDirectory directory)
        {
            if (owningProvider == null)
                throw new ArgumentNullException("owningProvider");

            if (directory == null)
                throw new ArgumentNullException("directory");

            this.VirtualPathProvider = owningProvider;
            this.Directory = directory;
        }
开发者ID:JonCanning,项目名称:ServiceStack,代码行数:12,代码来源:AbstractVirtualFileBase.cs


示例13: CopyBackingFileToDirectory

 protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     if (directory is FileSystemVirtualDirectory)
     {
         var copyFInfo = BackingFile.CopyTo(Path.Combine(directory.RealPath, name), true);
         return new FileSystemVirtualFile(VirtualPathProvider, directory, copyFInfo);
     }
     else
     {
         return directory.CopyFile(this, name);
     }
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:12,代码来源:FileSystemVirtualFile.cs


示例14: MoveBackingFileToDirectory

 protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     if (directory is FileSystemVirtualDirectory)
     {
         BackingFile.MoveTo(Path.Combine(directory.RealPath, name));
         return new FileSystemVirtualFile(VirtualPathProvider, directory, BackingFile);
     }
     else
     {
         var newFile = directory.CopyFile(this, name);
         this.Delete();
         return newFile;
     }
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:14,代码来源:FileSystemVirtualFile.cs


示例15: ResourceVirtualDirectory

        public ResourceVirtualDirectory(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm, String directoryName, IEnumerable<String> manifestResourceNames)
            : base(owningProvider, parentDir)
        {
            if (backingAsm == null)
                throw new ArgumentNullException("backingAsm");

            if (string.IsNullOrEmpty(directoryName))
                throw new ArgumentException("directoryName");

            this.backingAssembly = backingAsm;
            this.DirectoryName = directoryName;

            InitializeDirectoryStructure(manifestResourceNames);
        }
开发者ID:Qasemt,项目名称:NServiceKit,代码行数:14,代码来源:ResourceVirtualDirectory.cs


示例16: CopyBackingFileToDirectory

        protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is DropboxVirtualDirectory)
            {
                var dir = (DropboxVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    Provider.Copy(this.VirtualPath, Provider.CombineVirtualPath(directory.VirtualPath, name));
                    return new DropboxVirtualFile(Provider, dir, name);
                }
            }

            // TODO: copy cross Dropboxes using CopyRef?

            return directory.CopyFile(this, name);
        }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:16,代码来源:DropboxVirtualFile.cs


示例17: MoveBackingFileToDirectory

        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is SftpVirtualDirectory)
            {
                var dir = (SftpVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    ((SftpVirtualDirectory)this.Directory).RemoveFromCache(this);
                    File.Value.MoveTo(Provider.CombineVirtualPath(directory.VirtualPath, name));
                    return new SftpVirtualFile(Provider, dir, name, DateTime.Now);
                }
            }

            var newFile = directory.CopyFile(this, name);
            this.Delete();
            return newFile;
        }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:17,代码来源:SftpVirtualFile.cs


示例18: MoveBackingFileToDirectory

        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is FtpVirtualDirectory)
            {
                var dir = (FtpVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    var currentDir = (FtpVirtualDirectory)this.Directory;
                    currentDir.RemoveFromContents(this.Name);
                    Provider.Rename(this.VirtualPath, Provider.CombineVirtualPath(dir.VirtualPath, name));
                    return new FtpVirtualFile(Provider, dir, name, DateTime.Now);
                }
            }

            var newFile = directory.CopyFile(this, name);
            this.Delete();
            return newFile;
        }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:18,代码来源:FtpVirtualFile.cs


示例19: ResourceVirtualDirectory

        public ResourceVirtualDirectory(IVirtualPathProvider owningProvider, 
            IVirtualDirectory parentDir, 
            Assembly backingAsm, 
            string rootNamespace, 
            string directoryName, 
            List<string> manifestResourceNames)
            : base(owningProvider, parentDir)
        {
            if (backingAsm == null)
                throw new ArgumentNullException(nameof(backingAsm));

            if (string.IsNullOrEmpty(directoryName))
                throw new ArgumentNullException(nameof(directoryName));

            this.backingAssembly = backingAsm;
            this.rootNamespace = rootNamespace;
            this.DirectoryName = directoryName;

            InitializeDirectoryStructure(manifestResourceNames);
        }
开发者ID:AVee,项目名称:ServiceStack,代码行数:20,代码来源:ResourceVirtualDirectory.cs


示例20: BuildVirtualFiles

        public Dictionary<int, IVirtualFile> BuildVirtualFiles(IVirtualDirectory root, string name, int[] subRoots)
        {
            var subrootDir = root.GetDirectory(name);
            subRoots = getCounts(subrootDir, subRoots);

            XmlSerializer ser = new XmlSerializer(typeof(Group));
            var dict = new Dictionary<int, IVirtualFile>();
            foreach (var subroot in subRoots)
            {
                var fs = subrootDir.GetFile(subroot + ".xml").Open();
                if (fs == null) continue;

                var group = ser.Deserialize(fs) as Group;
                if (group == null) continue;

                foreach (var item in group.Source.Items)
                {
                    dict.Add(item.ID, item);
                }
            }
            return dict;
        }
开发者ID:Epibatidin,项目名称:FLUX,代码行数:22,代码来源:XMLVirtualFileProvider.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IVirtualFile类代码示例发布时间:2022-05-24
下一篇:
C# IVimWindowSettings类代码示例发布时间: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