public void FileNameAccess(string filesystem, string pathname, string name, string basename, string extension) { IFileName filename = null; switch (filesystem.ToLower()) { case "dragondos": filename = DragonDos.GetFileName(pathname); break; case "flex": filename = Flex.GetFileName(pathname); break; case "os9": filename = OS9.GetFileName(pathname); break; case "rsdos": filename = RsDos.GetFileName(pathname); break; default: Assert.True(false, "Unknown filesystem " + filesystem); break; } Assert.Equal(name, filename.Name); Assert.Equal(basename, filename.Base); Assert.Equal(extension, filename.Extension); //TODO Add test for Ascend method //TODO Add test for Descend method }
private void TypeSelectViewOnOnCreate(IFileName arg1, IExtension arg2) { var path = new FolderPath(_rootPath, arg1, arg2); OnSave(path, arg2); Hide(); }
public SevenZipFileSystem(IInArchive archive, IFileName rootName, IFileObject parentLayer, FileSystemOptions fileSystemOptions) : base(rootName, parentLayer, fileSystemOptions) { this.archive = archive; if (parentLayer.FileSystem is LocalFileSystem || parentLayer.Content.Size > 1048576) { file = parentLayer.FileSystem.replicateFile(parentLayer, Selectors.SELECT_SELF); } }
public SevenZipFileObject(IFileName name, uint index, SevenZipFileSystem fs, bool fileExists) : base(name, fs) { this.fs = fs; this.Index = index; if (!fileExists) { type = FileType.IMAGINARY; } }
private bool method_10(IFileName ifileName_0, bool bool_2) { int num; string path = ifileName_0.Path; if (Directory.Exists(path)) { num = path.LastIndexOf(@"\"); path = path.Substring(num + 1); path = this.string_0 + path; if (bool_2) { Directory.Move(ifileName_0.Path, path); } IGxObject obj2 = new GxFolder(); (obj2 as IGxFile).Path = path; obj2.Attach(this, this.igxCatalog_0); return(true); } num = path.LastIndexOf(@"\"); path = path.Substring(num + 1); string str2 = System.IO.Path.GetExtension(ifileName_0.Path).ToLower(); path = this.string_0 + path; if (path.ToLower() == ifileName_0.Path.ToLower()) { MessageBox.Show("无法复制 " + System.IO.Path.GetFileName(path) + " 源文件和目标文件相同!"); return(false); } if (File.Exists(path)) { string str3 = path.Substring(0, path.Length - str2.Length); path = str3 + "复件" + str2; for (int i = 1; File.Exists(path); i++) { path = str3 + "复件" + i.ToString() + str2; } } if (bool_2) { File.Move(ifileName_0.Path, path); } else { File.Copy(ifileName_0.Path, path); } string str4 = System.IO.Path.GetExtension(path).ToLower(); this.method_0(path, str4, true); return(true); }
public FolderPath(IPath root, IFileName folderName, IExtension extension) : this(Path.Combine(root.FullPath, $"{folderName.PlainText}{(extension.Type != NodeType.Directory ? "." : string.Empty)}{extension.PlainText}")) { }
public void attachChild(IFileName childName) { children.Add(childName.BaseName); }
private SevenZipFileObject createFileObject(IFileName name, uint index) { return new SevenZipFileObject(name, index, this, true); }
protected override IFileObject createFile(IFileName name) { // This is only called for files which do not exist in the Zip file return new SevenZipFileObject(name, UInt32.MaxValue, this, false); }