private void moveExtentMenuItem_Click(object sender, EventArgs e)
        {
            DynamicVolume     volume = (DynamicVolume)((KeyValuePair <Volume, DiskExtent>)extentContextMenu.Tag).Key;
            DynamicDiskExtent extent = (DynamicDiskExtent)((KeyValuePair <Volume, DiskExtent>)extentContextMenu.Tag).Value;

            List <DynamicDisk> dynamicDisks = GetDynamicDisks();
            List <DynamicDisk> diskGroup    = DynamicDiskHelper.FindDiskGroup(dynamicDisks, volume.DiskGroupGuid);

            bool isBootVolume;

            if (RetainHelper.IsVolumeRetained(volume, out isBootVolume))
            {
                StringBuilder builder = new StringBuilder();
                builder.AppendLine("You're trying to move a retained volume (volume that has a partition");
                builder.AppendLine("associated with it).");
                builder.AppendLine("If an operating system is present on this volume, a reconfiguration");
                builder.AppendLine("might be necessary before you could boot it successfully.");
                builder.AppendLine("This operation is currently not supported.");
                MessageBox.Show(builder.ToString(), "Warning");
                return;
            }

            if (DynamicDiskPartitionerResumeRecord.HasValidSignature(volume.ReadSector(0)))
            {
                StringBuilder builder = new StringBuilder();
                builder.AppendLine("There is already an operation in progress");
                builder.AppendLine("Use the RESUME command to resume the operation");
                MessageBox.Show(builder.ToString(), "Error");
                return;
            }

            MoveExtentForm moveExtent = new MoveExtentForm(diskGroup, volume, extent);
            DialogResult   result     = moveExtent.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (Environment.OSVersion.Version.Major >= 6)
                {
                    // Windows 7 / 2008 will likely make changes to the disk group, it will be marked as 'dirty' if we don't wait
                    Thread.Sleep(Windows6WaitTimeBeforeRefresh);
                }
                UpdateView();
                if (Environment.OSVersion.Version.Major >= 6)
                {
                    //MessageBox.Show("Please go to Disk Management and reactivate the disk group", "Operation completed successfully");
                    MessageBox.Show("Click OK to Continue", "Operation completed successfully");
                }
                else
                {
                    string message = OperatingSystemHelper.GetUpdateMessage();
                    MessageBox.Show(message, "Operation completed successfully");
                }
            }
        }
        private void DiskCollectionView_ExtentRightClick(object sender, ExtentRightClickEventArgs e)
        {
            bool isDynamicDisk   = false;
            bool hasResumeRecord = false;

            try
            {
                isDynamicDisk = DynamicDisk.IsDynamicDisk(e.Extent.Disk);
                if (e.Volume != null && (!(e.Volume is DynamicVolume) || ((DynamicVolume)e.Volume).IsOperational))
                {
                    hasResumeRecord = DynamicDiskPartitionerResumeRecord.HasValidSignature(e.Volume.ReadSector(0));
                }
            }
            catch (IOException)
            {
            }
            createVolumeMenuItem.Visible     = (e.Volume == null && isDynamicDisk);
            moveExtentMenuItem.Visible       = (e.Volume != null && e.Volume is DynamicVolume);
            resumeOperationMenuItem.Visible  = hasResumeRecord;
            extendVolumeMenuItem.Visible     = (e.Volume != null);
            volumePropertiesMenuItem.Visible = (e.Volume != null);
            fileSystemMenuItem.Visible       = (e.Volume != null);
            addDiskToVolumeMenuItem.Visible  = (e.Volume != null && e.Volume is Raid5Volume);

            bool isHealthy        = (e.Volume != null && (!(e.Volume is DynamicVolume) || ((DynamicVolume)e.Volume).IsHealthy));
            bool isOperational    = (e.Volume != null && (!(e.Volume is DynamicVolume) || ((DynamicVolume)e.Volume).IsOperational));
            bool isMirroredVolume = (e.Volume != null && e.Volume is MirroredVolume);

            extendVolumeMenuItem.Enabled    = isHealthy && !isMirroredVolume;
            moveExtentMenuItem.Enabled      = isOperational;
            fileSystemMenuItem.Enabled      = isOperational;
            addDiskToVolumeMenuItem.Enabled = isHealthy;

            extentContextMenu.Tag = new KeyValuePair <Volume, DiskExtent>(e.Volume, e.Extent);
            extentContextMenu.Show((Control)sender, e.Location);
        }