123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using DiskAccessLibrary;
- using static DiskAccessLibrary.Mod.Consts;
- namespace ISCSIConsole.Mods
- {
- public partial class SelectPhysicalDiskWithSnapForm : BaseForm
- {
- private PhysicalDisk _underlyingDisk;
- public SelectPhysicalDiskWithSnapForm()
- {
- InitializeComponent();
- }
- public Disk SelectedDisk { get; private set; }
- private void SelectDiskButton_Click(object sender, EventArgs e)
- {
- SelectPhysicalDiskForm selectPhysicalDisk = new SelectPhysicalDiskForm();
- DialogResult result = selectPhysicalDisk.ShowDialog();
- if (result == DialogResult.OK)
- {
- _underlyingDisk = selectPhysicalDisk.SelectedDisk;
- DiskTextBox.Text = $"{_underlyingDisk.Description} - {_underlyingDisk.SerialNumber}";
- var sb = new StringBuilder();
- sb.AppendLine($"Size: {_underlyingDisk.Size / MegaByte:N0} MB");
- sb.AppendLine($"Disk Index: {_underlyingDisk.PhysicalDiskIndex}");
- sb.AppendLine($"Bytes Per Sector: {_underlyingDisk.BytesPerSector}");
- DiskInfoValueLabel.Text = sb.ToString();
- }
- }
- private void SelectSnapButton_Click(object sender, EventArgs e)
- {
- if (_underlyingDisk == null)
- {
- MessageBox.Show("Select disk first.");
- return;
- }
- var dlg = new OpenFileDialog
- {
- Filter = "Physical Disk Differencing Disk Image (*.pdd)|*.pdd",
- CheckFileExists = false,
- };
- if (dlg.ShowDialog() == DialogResult.OK)
- {
- SnapFilePathTextBox.Text = dlg.FileName;
- if (File.Exists(SnapFilePathTextBox.Text))
- {
- }
- else
- {
-
- }
- }
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- }
- }
- }
|