示例#1
0
                    #Add the misspelled word to the drop down menu
                    #and make is the first item
                    c.AddText(y)
                    c.SelectedItem = y
                    #Offer alternative spellings in the drop down menu
                    for suggest in suggestions(y):
                        c.AddText(suggest)
                    #Add the combo box to the drop down menu
                    paragraph.Inlines.Add(c)
                else:
                    paragraph.Inlines.Add(Run(y))
                paragraph.Inlines.Add(" ")
            paragraph.Inlines.Add(Run("\n"))
        else:
            #If there's no comment in the line, just directly
            #add it to the paragraph
            paragraph.Inlines.Add(Run(x))
    return paragraph


#--MAIN------------------------------------------------------------------------
main_window.Title = "IronPython Comment Checker"
main_window.Background = Black
main_window.Foreground = PaleGreen
main_window.Content = FlowDocumentScrollViewer()
main_window.Content.Document = FlowDocument()
main_window.Content.Document.Blocks.Add(create_paragraph(lines_in_file))
main_window.Show()
Application().Run()
ms_word.Quit()
示例#2
0
                    c.HorizontalAlignment = HorizontalAlignment.Left
                    #Add the misspelled word to the drop down menu
                    #and make is the first item
                    c.AddText(y)
                    c.SelectedItem = y
                    #Offer alternative spellings in the drop down menu
                    for suggest in suggestions(y):
                        c.AddText(suggest)
                    #Add the combo box to the drop down menu
                    paragraph.Inlines.Add(c)
                else:
                    paragraph.Inlines.Add(Run(y))
                paragraph.Inlines.Add(" ")
            paragraph.Inlines.Add(Run("\n"))
        else:
            #If there's no comment in the line, just directly
            #add it to the paragraph
            paragraph.Inlines.Add(Run(x))
    return paragraph

#--MAIN------------------------------------------------------------------------
main_window.Title = "IronPython Comment Checker"
main_window.Background = Black
main_window.Foreground = PaleGreen
main_window.Content = FlowDocumentScrollViewer()
main_window.Content.Document = FlowDocument()
main_window.Content.Document.Blocks.Add(create_paragraph(lines_in_file))
main_window.Show()
Application().Run()
ms_word.Quit()