예제 #1
0
파일: Main.cs 프로젝트: DawangLi/RtfHelper
        private static void FormatRtf()
        {
            IntPtr           currentScint     = PluginBase.GetCurrentScintilla();
            ScintillaGateway scintillaGateway = new ScintillaGateway(currentScint);

            string allText = scintillaGateway.GetAllText();

            if (!IsTextRtf(allText))
            {
                return;
            }

            string newText = rtfFormatter.GetFormattedText(allText);

            if (allText != newText)
            {
                scintillaGateway.SetText(newText);
            }
        }