Beispiel #1
0
        /// <summary>
        /// Creates the allocation maps.
        /// </summary>
        /// <param name="files">The database files.</param>
        public void CreateAllocationMaps(List <DatabaseFile> files)
        {
            SuspendLayout();

            tableLayoutPanel.SuspendLayout();
            tableLayoutPanel.Controls.Clear();
            AllocationMaps.Clear();

            tableLayoutPanel.RowCount = 2;
            tableLayoutPanel.RowStyles.Clear();

            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 1.0F));

            var fileIndex = 0;

            foreach (var file in files)
            {
                var allocationMap = CreateAllocationMap(file);
                allocationMap.ExtentSize = ExtentSize;
                allocationMap.Mode       = Mode;

                var filePanel = new Panel();
                filePanel.Margin = new Padding(0);
                filePanel.Controls.Add(allocationMap);

                filePanel.Dock = DockStyle.Fill;
                tableLayoutPanel.Controls.Add(filePanel, 1, fileIndex);

                filePanel.Margin = new Padding(0, 0, 0, 4);

                if (fileIndex > 0)
                {
                    tableLayoutPanel.RowCount += 1;
                    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 1.0F));
                }

                if (!showFileInformation && fileIndex == files.Count - 1)
                {
                    filePanel.Margin = new Padding(0);
                }
                else if (showFileInformation)
                {
                    filePanel.Controls.Add(new FileInformationControl(file));
                }

                fileIndex++;
            }

            tableLayoutPanel.Invalidate();
            tableLayoutPanel.ResumeLayout();

            ResumeLayout();
        }
Beispiel #2
0
        /// <summary>
        /// Creates the allocation map.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <returns></returns>
        private AllocationMap CreateAllocationMap(DatabaseFile file)
        {
            var allocationMap = new AllocationMap();

            allocationMap.FileId      = file.FileId;
            allocationMap.File        = file;
            allocationMap.ExtentCount = file.Size / 8;
            allocationMap.Dock        = DockStyle.Fill;
            allocationMap.MapLayers   = AllocationLayers;

            allocationMap.PageClicked   += AllocationMap_PageClicked;
            allocationMap.PageOver      += AllocationMap_PageOver;
            allocationMap.RangeSelected += AllocationMap_RangeSelected;

            AllocationMaps.Add(file.FileId, allocationMap);

            return(allocationMap);
        }