private void saveFile() { file.content = new TextRange(textbox.Document.ContentStart, textbox.Document.ContentEnd).Text; file.modifiedTime = Utility.getCurrentTime(); MyFileSystem fs = MyFileSystem.Instance(); fs.UpdateFile(file); label.Content = String.Format(labelFormat, fs.DiskSize, fs.SpaceUsed, fs.DiskSize - fs.SpaceUsed); }
public MainWindow(int t) { InitializeComponent(); Initialize(); mFs = MyFileSystem.Instance(); mFs.RegisterWindow(this); UpdateShowGrid(); UpdateTreeView(); this.tbDir.Text = mFs.currentDir.getFileLoc(); window_cnt = t; }
public PropertyWindow(FileEntry file) { InitializeComponent(); string uri = (file.fileType == EnumFileType.TxtFile ? "images/file.png" : "images/folder.png"); this.image.Source = new BitmapImage(new Uri(uri, UriKind.Relative)); this.textbox.Text = file.fileName; this.tbFileType.Text = (file.fileType == EnumFileType.TxtFile ? "Text File" : "Folder"); this.tbFileLoc.Text = file.getFileLoc(); this.tbFileSize.Text = file.size.ToString() + " bytes"; this.tbFileSizeOnDisk.Text = MyFileSystem.Instance().GetFileSizeOnDisk(file).ToString() + " kb"; this.tbFileCreated.Text = file.createdTime; this.tbFileModified.Text = file.modifiedTime; this.tbFileOnDiskLoc.Text = "start at " + file.firstBlock + ", end at " + file.lastBlock; }
public MainWindow() { InitializeComponent(); Initialize(); if (!Deserialize()) { mFs = MyFileSystem.Instance(); mFs.EnterNextDir("user"); } mFs.InitRegister(); mFs.RegisterWindow(this); UpdateShowGrid(); UpdateTreeView(); this.tbDir.Text = mFs.currentDir.getFileLoc(); window_cnt = ++window_total; }