Ejemplo n.º 1
0
        private void buttonChosePartition_Click(object sender, EventArgs e)
        {
            var          sp  = new SelectPartition();
            DialogResult res = sp.ShowDialog();

            _partnummber = sp._partnummber;
            _diskmodel   = sp._diskmodel;
            _disknummber = sp._disknummber;
            _diskserial  = sp._diskserial;
            _pnpdeviceid = sp._pNPDeviceID;

            if (res == DialogResult.OK)
            {
                if (string.IsNullOrEmpty(_partnummber))
                {
                    throw new Exception(LanguagePool.GetInstance().GetString(LanguageRegion, "MessagePartnumberEmpty", _language));
                }
                if (string.IsNullOrEmpty(_disknummber))
                {
                    throw new Exception(LanguagePool.GetInstance().GetString(LanguageRegion, "MessageDisknumberEmpty", _language));
                }
                if (string.IsNullOrEmpty(_pnpdeviceid))
                {
                    throw new Exception(LanguagePool.GetInstance().GetString(LanguageRegion, "MessagePNPDeviceIDEmpty", _language));
                }

                textBoxPartition.Text    = "\\Device\\Harddisk" + _disknummber + "\\Partition" + _partnummber;
                textBox_PNPDeviceID.Text = _pnpdeviceid;
            }
        }
Ejemplo n.º 2
0
        private void buttonSelectDrive_Click(object sender, EventArgs e)
        {
            SelectPartition sp  = new SelectPartition();
            DialogResult    res = sp.ShowDialog();

            if (res == DialogResult.OK)
            {
                _pnpid       = sp._pNPDeviceID;
                _partnummber = sp._partnummber;
                textBoxSelectedDrive.Text = sp._diskmodel + " Partition: " + sp._partnummber;
            }
        }