本文整理汇总了C#中IVirtualDirectory类的典型用法代码示例。如果您正苦于以下问题:C# IVirtualDirectory类的具体用法?C# IVirtualDirectory怎么用?C# IVirtualDirectory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVirtualDirectory类属于命名空间,在下文中一共展示了IVirtualDirectory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setup
public void setup()
{
_provider = new DirectoryVirtualFileProvider();
_root = MockRepository.GenerateMock<IVirtualDirectory>();
_provider.Setup(_root);
}
示例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;
}
示例3: AzureBlobVirtualFile
public AzureBlobVirtualFile(AzureBlobVirtualPathProvider owningProvider, IVirtualDirectory directory)
: base(owningProvider, directory)
{
this.pathProvider = owningProvider;
this.container = pathProvider.Container;
}
示例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;
}
}
示例5: FileSystemVirtualDirectory
public FileSystemVirtualDirectory(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory, DirectoryInfo dInfo)
: base(owningProvider, parentDirectory)
{
if (dInfo == null)
throw new ArgumentNullException("dInfo");
this.BackingDirInfo = dInfo;
}
示例6: AbstractVirtualDirectoryBase
protected AbstractVirtualDirectoryBase(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory)
{
if (owningProvider == null)
throw new ArgumentNullException("owningProvider");
this.VirtualPathProvider = owningProvider;
this.ParentDirectory = parentDirectory;
}
示例7: FileSystemVirtualFile
public FileSystemVirtualFile(IVirtualPathProvider owningProvider, IVirtualDirectory directory, FileInfo fInfo)
: base(owningProvider, directory)
{
if (fInfo == null)
throw new ArgumentNullException("fInfo");
this.BackingFile = fInfo;
}
示例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));
}
示例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;
}
示例10: ResourceVirtualDirectory
public ResourceVirtualDirectory(IVirtualPathProvider owningProvider,
IVirtualDirectory parentDir,
Assembly backingAsm,
string rootNamespace)
: this(owningProvider,
parentDir,
backingAsm,
rootNamespace,
rootNamespace,
GetResourceNames(backingAsm, rootNamespace)) { }
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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);
}