Beispiel #1
0
        public const int BLOCK_CONTENT_LENGTH = 12;             //块的数据容量度量

        public FileShow(FAT _disk, FCB _currentFile)
        {
            InitializeComponent();

            disk        = _disk;
            currentFile = _currentFile;

            FileName_Text.Text = currentFile.name;
            FileSize_Text.Text = Convert.ToString(currentFile.size);

            FileContent_Text.Text = disk.ExtractFileContent(currentFile);
        }
Beispiel #2
0
        private void FileEdit_Button_Click(object sender, RoutedEventArgs e)
        {
            FileEdit fileEditWindow = new FileEdit();

            fileEditWindow.ShowDialog();

            string newFileContent = fileEditWindow._newFileContent;

            if (newFileContent == null)
            {
                return;
            }
            currentFile.size = newFileContent.Count() / BLOCK_CONTENT_LENGTH + 1;
            disk.EditFileContent(currentFile, newFileContent);

            FileSize_Text.Text    = Convert.ToString(currentFile.size);
            FileContent_Text.Text = disk.ExtractFileContent(currentFile);
        }