public HeapToHTMLPageEntireListing(HeapReconstructor aReconstructor, TSortType aSortType, string aFileName) : base(aFileName) { iSortType = aSortType; iReconstructor = aReconstructor; // Make a new (but empty) array iEntries = new HeapCellArray(aReconstructor.Data.Count + 1); // Depending on the sort type, trigger the sort method // in the array. Since the array is empty this won't // do a lot, except set up the array to use our chosen // comparison object... switch (iSortType) { default: case TSortType.ESortTypeByAddress: iEntries.SortByAddress(); break; case TSortType.ESortTypeByType: iEntries.SortByType(); break; case TSortType.ESortTypeByLength: iEntries.SortByLength(); break; } // Now copy the entries into the array iEntries.Copy(aReconstructor.Data); }
public static string PageFileName(TSortType aSortType) { string ret = "EntireHeapListing_"; // switch (aSortType) { default: case TSortType.ESortTypeByAddress: ret += "ByAddress"; break; case TSortType.ESortTypeByType: ret += "ByType"; break; case TSortType.ESortTypeByLength: ret += "ByLength"; break; } // ret += ".html"; // return(ret); }
private void MakeColumnHeading(string aTitle, TAlignment aAlignment, TSortType aSortType) { if (iSortType != aSortType) { string toolTipBody = "Sort by "; // switch (aSortType) { default: case TSortType.ESortTypeByAddress: toolTipBody += "address"; break; case TSortType.ESortTypeByType: toolTipBody += "type"; break; case TSortType.ESortTypeByLength: toolTipBody += "length"; break; } // string url = PageFileName(aSortType); string linkWithToolTip = HeapToHTMLPageJavaScriptManager.MakeToolTipLink("Sorting", toolTipBody, url, string.Empty, aTitle); // WriteTableColumnBegin(aAlignment, "tableHeaders"); WriteLine(linkWithToolTip); WriteTableColumnEnd(); } else { WriteTableColumn(aTitle, aAlignment, "tableHeaderSelected"); } }