我将多页打印的C#代码翻译成F#。有人可以告诉我如何翻译:
((IAddChild)page1Content).AddChild(page1)
上下文:
// printdia = printdialog
// printdoc = printdocument
// create a page
let page1 = new System.Windows.Documents.FixedPage()
page1.Width <- printdoc.DocumentPaginator.PageSize.Width
page1.Height <- printdoc.DocumentPaginator.PageSize.Height
page1.Children.Add(printcanvas) |> ignore
// add the page to the document
let page1Content = new System.Windows.Documents.PageContent()
(*C#*)((IAddChild)page1Content).AddChild(page1)
printdoc.Pages.Add(page1Content) |> ignore
// and print
printdia.PrintDocument(printdoc.DocumentPaginator, ordernr.Text);