コード例 #1
0
        private void OpenImg()
        {
            OpenFileDialog imgOpenDialog = new OpenFileDialog();

            imgOpenDialog.Filter          = "Image files (*.img)|*.img";
            imgOpenDialog.FilterIndex     = 0;
            imgOpenDialog.CheckFileExists = true;
            imgOpenDialog.Multiselect     = false;

            if (imgOpenDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            try
            {
                _rawImageSource = new RawImageSource(imgOpenDialog.FileName);
                _bobFs          = BobFs.Mount(_rawImageSource);
                Text            = $"WinBobFS - {imgOpenDialog.SafeFileName}";
            }
            catch (Exception)
            {
                MessageBox.Show(this, "BobFS image is not valid.", "WinBobFS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            PopulateExplorerTree();
            PopulateExplorerList(_bobFs.Root);

            NewFileButton.Enabled      = true;
            NewDirectoryButton.Enabled = true;
            //NewLinkButton.Enabled = true;
            //InfoButton.Enabled = true;
            ImportButton.Enabled   = true;
            ExplorerList.AllowDrop = true;
        }
コード例 #2
0
        private void NewImg()
        {
            _rawImageSource = new RawImageSource();
            _bobFs          = BobFs.Mkfs(_rawImageSource);
            Text            = $"WinBobFS - <New>";

            PopulateExplorerTree();
            PopulateExplorerList(_bobFs.Root);

            NewFileButton.Enabled      = true;
            NewDirectoryButton.Enabled = true;
            ImportButton.Enabled       = true;
            ExplorerList.AllowDrop     = true;
        }