ผมมี Code อยู่ แต่ไม่เข้าใจ ว่า บรรทัดนี้ มัน ไปเรียกชื่อตัวเอง ทำงายอย่างไรครับ
FillHTMLTreeRecursive( olParent.Add( ol), ref htmlString, ref pdfDoc);อยากรบกวน CONVERT เป็น C# ให้ด้วย
Code VB.NET
Public Shared Sub FillHTMLTreeRecursive(ByVal olParent As PDFLibNet.OutlineItemCollection(Of PDFLibNet.OutlineItem), ByRef htmlString As String, ByRef pdfDoc As PDFLibNet.PDFWrapper)
htmlString &= "<ul>"
For Each ol As PDFLibNet.OutlineItem In olParent
htmlString &= "<li><a href=""javascript:changePage('" & ol.Destination.Page & "')"">" &
Web.HttpUtility.HtmlEncode(ol.Title) & "</a></li>"
If ol.KidsCount > 0 Then
FillHTMLTreeRecursive(ol.Childrens, htmlString, pdfDoc)
End If
Next
htmlString &= "</ul>"
End Sub
ลองแปลงเป็น C# แล้ว Error
public static void FillHTMLTreeRecursive(
PDFLibNet.OutlineItemCollection<PDFLibNet.OutlineItem> olParent
, ref string htmlString
, ref PDFLibNet.PDFWrapper pdfDoc)
{
htmlString += "<ul>";
foreach (PDFLibNet.OutlineItem ol in olParent)
{
htmlString += "<li><a href=\"javascript:changePage('" + ol.Destination.Page + "')\">" + System.Web.HttpUtility.HtmlEncode(ol.Title) + "</a></li>";
if (ol.KidsCount > 0)
{
FillHTMLTreeRecursive( olParent.Add( ol), ref htmlString, ref pdfDoc);
}
}
htmlString += "</ul>";
}
