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


C# IVirtualDirectory.CopyFile方法代码示例

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


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

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

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

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

示例4: CopyBackingFileToDirectory

 protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     return directory.CopyFile(this, name);
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:4,代码来源:FtpVirtualFile.cs

示例5: MoveBackingFileToDirectory

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

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

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

示例7: MoveBackingFileToDirectory

 protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     var newFile = directory.CopyFile(this, name);
     this.Delete();
     return newFile;
 }
开发者ID:RainsSoft,项目名称:VirtualPath,代码行数:6,代码来源:InMemoryVirtualPathProvider.cs

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


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