Exemplo n.º 1
0
        public override DialogResult CreateContent(IWin32Window dialogOwner, ref string newContent)
        {
            InsertTextWindow wnd = new InsertTextWindow(m_config, newContent);
            DialogResult     res = wnd.ShowDialog();

            if (res == DialogResult.OK)
            {
                String titleTemplate = wnd.Title.Length > 0 ? " title=\"" + wnd.Title + "\"" : "";

                String numberingTemplate = "";
                if (wnd.Numbering == 1)
                {
                    numberingTemplate = " linenumbers=\"on\" start=\"" + wnd.StartNumber + "\"";
                }
                else if (wnd.Numbering == 2)
                {
                    numberingTemplate = " linenumbers=\"fancy\" start=\"" + wnd.StartNumber + "\"";
                }

                String collapsibleTemplate = wnd.IsCollapsible ? " collapsible=\"true\"" : "";

                newContent = wnd.BlockStyle;
                if (newContent.Length > 0)
                {
                    newContent = newContent.Replace("$title", titleTemplate);
                    newContent = newContent.Replace("$numbering", numberingTemplate);
                    newContent = newContent.Replace("$collapsible", collapsibleTemplate);
                    newContent = newContent.Replace("$language", wnd.Lang);
                    newContent = newContent.Replace("$code", "\n" + wnd.Code + "\n");
                }
            }
            return(res);
        }
Exemplo n.º 2
0
        public override DialogResult CreateContent(IWin32Window dialogOwner, ref string newContent)
        {
            InsertTextWindow wnd = new InsertTextWindow(m_config, newContent);
            DialogResult res = wnd.ShowDialog();

            if (res == DialogResult.OK)
            {
                String titleTemplate = wnd.Title.Length > 0 ? " title=\"" + wnd.Title + "\"" : "";

                String numberingTemplate = "";
                if (wnd.Numbering == 1)
                {
                    numberingTemplate = " linenumbers=\"on\" start=\"" + wnd.StartNumber + "\"";
                }
                else if (wnd.Numbering == 2)
                {
                    numberingTemplate = " linenumbers=\"fancy\" start=\"" + wnd.StartNumber + "\"";
                }

                String collapsibleTemplate = wnd.IsCollapsible ? " collapsible=\"true\"" : "";

                newContent = wnd.BlockStyle;
                if (newContent.Length > 0)
                {
                    newContent = newContent.Replace("$title", titleTemplate);
                    newContent = newContent.Replace("$numbering", numberingTemplate);
                    newContent = newContent.Replace("$collapsible", collapsibleTemplate);
                    newContent = newContent.Replace("$language", wnd.Lang);
                    newContent = newContent.Replace("$code", "\n" + wnd.Code + "\n");
                }
            }
            return res;
        }