Beispiel #1
0
        internal void AddDisk(VirtualHardDisk vhd)
        {
            using (RotateWaitThreaded.Hold("Generating View for {0}", Path.GetFileNameWithoutExtension(vhd.Filename)))
            {
                if (vhd.vhdReadException != null)
                {
                    // TODO: Handle virtualDIskException

                    VhdPartitionView vhdview = new VhdPartitionView();
                    vhdview.Icon = Icon;

                    vhdview.AddDisk(vhd);
                    vhdview.remove += new VhdPartitionView.RemoveHandler(vhdview_remove);

                    // When vhdview is added, it does a hell of a lot of drawing of greenpartitionlayout for no reason.
                    flowLayoutPanel1.Controls.Add(vhdview);
                }

                else
                {
                    VhdPartitionView vhdview = new VhdPartitionView();
                    vhdview.Icon = Icon;

                    vhdview.AddDisk(vhd);
                    vhdview.remove += new VhdPartitionView.RemoveHandler(vhdview_remove);

                    // When vhdview is added, it does a hell of a lot of drawing of greenpartitionlayout for no reason.
                    flowLayoutPanel1.Controls.Add(vhdview);
                }
            }
        }
Beispiel #2
0
        // Dispose(bool disposing) executes in two distinct scenarios.
        // If disposing equals true, the method has been called directly
        // or indirectly by a user's code. Managed and unmanaged resources
        // can be disposed.
        // If disposing equals false, the method has been called by the
        // runtime from inside the finalizer and you should not reference
        // other objects. Only unmanaged resources can be disposed.
        protected virtual void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if (!this.disposed)
            {
                // If disposing equals true, dispose all managed
                // and unmanaged resources.
                if (disposing)
                {
                    // Dispose managed resources.
                    // component.Dispose();
                    sw.Stop();
                    TimeSpan layoutTime = sw.Elapsed;
                    System.Console.WriteLine("Held for {0} ms ({1})", layoutTime.Milliseconds, name);
                }
                else
                {
                    sw.Stop();
                    TimeSpan layoutTime = sw.Elapsed;
                    System.Console.WriteLine("(Finalise) {1} took: {0} ms", layoutTime.Milliseconds, name);
                }
                // Call the appropriate methods to clean up
                // unmanaged resources here.
                // If disposing is false,
                // only the following code is executed.
                // CloseHandle(handle);
                // handle = IntPtr.Zero;

                RotateWaitThreaded.ReleaseConsole();


                // Note disposing has been done.
                disposed = true;
            }
        }
Beispiel #3
0
 public RotateWaitHolder(string name = "")
 {
     this.name = name;
     RotateWaitThreaded.HoldConsole();
     sw = new System.Diagnostics.Stopwatch();
     sw.Start();
 }
Beispiel #4
0
        private void ShowDetailedUsage()
        {
            using (RotateWaitThreaded.Hold("Processing MBR for {0}", vhd.Filename))
            {
                // Sorry, I know it looks like there is a MVC pattern in use, but really it's just
                // a giant f*****g mess.

                DiskUsageView       duv = new DiskUsageView();
                DiskUsageModel      dum = new DiskUsageModel(vhd.masterBootRecord.getPartitionRecords());
                DiskUsageController duc = new DiskUsageController();
                // DiskModel dm = new DiskModel(vhd.footer, vhd.dynamicHeader, vhd.blockAllocationTable, vhd.masterBootRecord);
            }
        }