Example #1
0
        public void FormatXaml()
        {
            string xmlText = base.Document.TextContent.Trim();

            xmlText = xmlText.Replace("\r\n", "");
            string formatXml = XmlPrettyFormatter.Format(xmlText);

            Document.TextContent = formatXml;


            FormatBuffer buffer = new FormatBuffer();

            buffer.Execute(base.TextArea);

            base.TextArea.Focus();
        }
Example #2
0
        public bool FormatScript()
        {
            TextArea     textArea     = null;
            FormatBuffer formatBuffer = null;

            try
            {
                textArea     = this.textEditorControl1.ActiveTextAreaControl.TextArea;
                formatBuffer = new FormatBuffer();
                formatBuffer.Execute(textArea);
                return(true);
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLog("ScriptEditForm.FormatScript", ex);
                return(false);
            }
        }