Esempio n. 1
0
        private void PreviewStyle(Style s)
        {
            lblPreview.ForeColor = s.ForeColor;
            lblPreview.BackColor = s.BackColor != Color.Transparent ? s.BackColor : sb.BackColor;

            FontStyle fs = FontStyle.Regular;
            if (s.FontBold)
                fs |= FontStyle.Bold;
            if (s.FontItalic)
                fs |= FontStyle.Italic;
            if (s.FontUnderline)
                fs |= FontStyle.Underline;

            lblPreview.Font = new Font("Courier New", 11f, fs);
        }
Esempio n. 2
0
        public SettingsForm(SyntaxBoxControl sb)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.sb = sb;

            SyntaxDefinition l = sb.Document.Parser.SyntaxDefinition;
            TextStyle[] tss = l.Styles;

            lbStyles.Items.Clear();
            for (int i = 0; i < tss.Length; i++)
            {
                TextStyle ts = tss[i];
                var s = new Style {TextStyle = ts, Name = ts.Name};
                //s.Name=ts.Name;
                lbStyles.Items.Add(s);
            }
            lbStyles.SelectedIndex = 0;
        }