本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例4: CopyBackingFileToDirectory
protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
{
return directory.CopyFile(this, name);
}
示例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;
}
示例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;
}
示例7: MoveBackingFileToDirectory
protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
{
var newFile = directory.CopyFile(this, name);
this.Delete();
return newFile;
}
示例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;
}
}