public bool AllocationStatus(PageType pageType) { var interval = Database.AllocationInterval; var page = new AllocationPage(Database, Allocation.AllocationPageAddress(PageAddress, pageType)); return(page.AllocationMap[(interval / 8) + 1]); }
/// <summary> /// Refreshes the allocation status from the various allocation pages /// </summary> /// <param name="pageAddress">The page address.</param> private void RefreshAllocationStatus(PageAddress pageAddress) { Image unallocated = ExtentColour.KeyImage(Color.Gainsboro); Image gamAllocated = ExtentColour.KeyImage(Color.FromArgb(172, 186, 214)); Image sGamAllocated = ExtentColour.KeyImage(Color.FromArgb(168, 204, 162)); Image dcmAllocated = ExtentColour.KeyImage(Color.FromArgb(120, 150, 150)); Image bcmAllocated = ExtentColour.KeyImage(Color.FromArgb(150, 120, 150)); gamPictureBox.Image = Page.AllocationStatus(PageType.Gam) ? unallocated : gamAllocated; sGamPictureBox.Image = Page.AllocationStatus(PageType.Sgam) ? sGamAllocated : unallocated; dcmPictureBox.Image = Page.AllocationStatus(PageType.Dcm) ? dcmAllocated : unallocated; bcmPictureBox.Image = Page.AllocationStatus(PageType.Bcm) ? bcmAllocated : unallocated; gamTextBox.Text = Allocation.AllocationPageAddress(pageAddress, PageType.Gam).ToString(); sgamTextBox.Text = Allocation.AllocationPageAddress(pageAddress, PageType.Sgam).ToString(); dcmTextBox.Text = Allocation.AllocationPageAddress(pageAddress, PageType.Dcm).ToString(); bcmTextBox.Text = Allocation.AllocationPageAddress(pageAddress, PageType.Bcm).ToString(); pfsTextBox.Text = Allocation.AllocationPageAddress(pageAddress, PageType.Pfs).ToString(); pfsByte = Page.PfsStatus(); pfsPanel.Invalidate(); }
public PfsByte PfsStatus() { var pfsPage = new PfsPage(Database, Allocation.AllocationPageAddress(PageAddress, PageType.Pfs)); return(pfsPage.PfsBytes[PageAddress.PageId % Database.PfsInterval]); }