private void SetFormatter()
        {
            PoorMansTSqlFormatterLib.Interfaces.ISqlTreeFormatter innerFormatter;
            if (radio_Formatting_Standard.Checked)
            {
                innerFormatter = new PoorMansTSqlFormatterLib.Formatters.TSqlStandardFormatter(
                    txt_Indent.Text,
                    int.Parse(txt_IndentWidth.Text),
                    int.Parse(txt_MaxWidth.Text),
                    chk_ExpandCommaLists.Checked,
                    chk_TrailingCommas.Checked,
                    chk_SpaceAfterComma.Checked,
                    chk_ExpandBooleanExpressions.Checked,
                    chk_ExpandCaseStatements.Checked,
                    chk_ExpandBetweenConditions.Checked,
                    chk_BreakJoinOnSections.Checked,
                    chk_UppercaseKeywords.Checked,
                    chk_Coloring.Checked,
                    chk_EnableKeywordStandardization.Checked
                    );
            }
            else
            {
                innerFormatter = new PoorMansTSqlFormatterLib.Formatters.TSqlIdentityFormatter(chk_IdentityColoring.Checked);
            }

            innerFormatter.ErrorOutputPrefix = _generalResourceManager.GetString("ParseErrorWarningPrefix");
            _formatter = new PoorMansTSqlFormatterLib.Formatters.HtmlPageWrapper(innerFormatter);
        }
Exemple #2
0
        public AboutBox()
        {
            InitializeComponent();
            this.Text = String.Format(_generalResourceManager.GetString("AboutTitleLabel"), AssemblyTitle);
            this.labelProductName.Text   = String.Format("{0}, v{1}", AssemblyProduct, AssemblyVersion);
            this.labelCopyright.Text     = AssemblyCopyright;
            this.textBoxDescription.Text = _generalResourceManager.GetString("ProjectAboutDescription");

            string GPLText = "";

            try
            {
                Stream       fileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Program).Namespace + ".LICENSE.txt");
                StreamReader textReader = new StreamReader(fileStream, System.Text.Encoding.ASCII);
                GPLText = textReader.ReadToEnd();
                textReader.Close();
                fileStream.Close();
            }
            catch (Exception ex)
            {
#if (DEBUG)
                MessageBox.Show("Exception! " + ex.ToString());
#endif
            }
            this.textBoxDescription.Text += System.Environment.NewLine + System.Environment.NewLine + GPLText;
        }
Exemple #3
0
        public AboutBox()
        {
            InitializeComponent();
            this.Text = String.Format(_generalResourceManager.GetString("AboutTitleLabel"), AssemblyTitle);
            this.labelProductName.Text   = String.Format("{0}, v{1}", AssemblyProduct, AssemblyVersion);
            this.labelCopyright.Text     = AssemblyCopyright;
            this.textBoxDescription.Text = _generalResourceManager.GetString("ProjectAboutDescription");

            string GPLText = "";

            using (Stream fileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Program).Namespace + ".LICENSE.txt"))
                using (StreamReader textReader = new StreamReader(fileStream, System.Text.Encoding.ASCII))
                {
                    GPLText = textReader.ReadToEnd();
                }

            this.textBoxDescription.Text += System.Environment.NewLine + System.Environment.NewLine + GPLText;
        }
Exemple #4
0
        private void SetFormatter()
        {
            ISqlTreeFormatter innerFormatter;

            if (radio_Formatting_Standard.Checked)
            {
                innerFormatter = new PoorMansTSqlFormatterLib.Formatters.TSqlStandardFormatter(new PoorMansTSqlFormatterLib.Formatters.TSqlStandardFormatterOptions
                {
                    IndentString             = txt_Indent.Text,
                    SpacesPerTab             = int.Parse(txt_IndentWidth.Text),
                    MaxLineWidth             = int.Parse(txt_MaxWidth.Text),
                    ExpandCommaLists         = chk_ExpandCommaLists.Checked,
                    TrailingCommas           = chk_TrailingCommas.Checked,
                    SpaceAfterExpandedComma  = chk_SpaceAfterComma.Checked,
                    ExpandBooleanExpressions = chk_ExpandBooleanExpressions.Checked,
                    ExpandCaseStatements     = chk_ExpandCaseStatements.Checked,
                    ExpandBetweenConditions  = chk_ExpandBetweenConditions.Checked,
                    ExpandInLists            = chk_ExpandInLists.Checked,
                    BreakJoinOnSections      = chk_BreakJoinOnSections.Checked,
                    UppercaseKeywords        = chk_UppercaseKeywords.Checked,
                    HTMLColoring             = chk_Coloring.Checked,
                    KeywordStandardization   = chk_EnableKeywordStandardization.Checked,
                    NewStatementLineBreaks   = int.Parse(txt_StatementBreaks.Text),
                    NewClauseLineBreaks      = int.Parse(txt_ClauseBreaks.Text)
                });
            }
            else if (radio_Formatting_Identity.Checked)
            {
                innerFormatter = new PoorMansTSqlFormatterLib.Formatters.TSqlIdentityFormatter(chk_IdentityColoring.Checked);
            }
            else
            {
                innerFormatter = new PoorMansTSqlFormatterLib.Formatters.TSqlObfuscatingFormatter(
                    chk_RandomizeKeywordCase.Checked,
                    chk_RandomizeColor.Checked,
                    chk_RandomizeLineLength.Checked,
                    chk_PreserveComments.Checked,
                    chk_KeywordSubstitution.Checked
                    );
            }

            innerFormatter.ErrorOutputPrefix = _generalResourceManager.GetString("ParseErrorWarningPrefix") + Environment.NewLine;
            _formatter = new PoorMansTSqlFormatterLib.Formatters.HtmlPageWrapper(innerFormatter);
        }