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();
        }