当前位置: 首页>>代码示例>>C#>>正文


C# Scintilla.StyleResetDefault方法代码示例

本文整理汇总了C#中ScintillaNET.Scintilla.StyleResetDefault方法的典型用法代码示例。如果您正苦于以下问题:C# Scintilla.StyleResetDefault方法的具体用法?C# Scintilla.StyleResetDefault怎么用?C# Scintilla.StyleResetDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScintillaNET.Scintilla的用法示例。


在下文中一共展示了Scintilla.StyleResetDefault方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CodeView

        public CodeView()
        {
            InitializeComponent();

            this.scintilla1 = new ScintillaNET.Scintilla();
            this.Controls.Add(this.scintilla1);
            this.scintilla1.Dock = DockStyle.Fill;
            this.scintilla1.TabIndex = 1;
            this.scintilla1.Text = "scintilla1";
            this.scintilla1.HScrollBar = true;
            this.scintilla1.VScrollBar = true;

            scintilla1.Margins[0].Type = MarginType.Number;
            scintilla1.Margins[0].Width = 35;

            // Display whitespace in orange
            scintilla1.WhitespaceSize = 2;
            scintilla1.ViewWhitespace = WhitespaceMode.VisibleAlways;
            scintilla1.SetWhitespaceForeColor(true, Color.FromArgb(43, 145, 175));

            // Configuring the default style with properties
            // we have common to every lexer style saves time.
            scintilla1.StyleResetDefault();
            scintilla1.Styles[Style.Default].Font = "Consolas";
            scintilla1.Styles[Style.Default].Size = 14;
            scintilla1.StyleClearAll();

            // Configure the CPP (C#) lexer styles
            scintilla1.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
            scintilla1.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green
            scintilla1.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green
            scintilla1.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
            scintilla1.Styles[Style.Cpp.Number].ForeColor = Color.Olive;
            scintilla1.Styles[Style.Cpp.Word].ForeColor = Color.Blue;
            scintilla1.Styles[Style.Cpp.Word2].ForeColor = Color.Blue;
            scintilla1.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red
            scintilla1.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red
            scintilla1.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red
            scintilla1.Styles[Style.Cpp.StringEol].BackColor = Color.Pink;
            scintilla1.Styles[Style.Cpp.Operator].ForeColor = Color.Purple;
            scintilla1.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon;
            scintilla1.Lexer = Lexer.Cpp;

            // Set the keywords
            scintilla1.SetKeywords(0, "abstract as base break case catch checked continue default delegate do else event explicit extern false finally fixed for foreach goto if implicit in interface internal is lock namespace new null object operator out override params private protected public readonly ref return sealed sizeof stackalloc switch this throw true try typeof unchecked unsafe using virtual while");
            scintilla1.SetKeywords(1, "bool byte char class const decimal double enum float int long sbyte short static string struct uint ulong ushort void");

            scintilla1.CharAdded += Scintilla1_CharAdded;
        }
开发者ID:zhh007,项目名称:CKGen,代码行数:49,代码来源:CodeView.cs

示例2: SetupScintilla

        private void SetupScintilla(Scintilla scintilla)
        {
            scintilla.StyleResetDefault();
            scintilla.Styles[Style.Default].Font = "Consolas";
            scintilla.Styles[Style.Default].Size = 10;
            scintilla.StyleClearAll();

            // Configure the CPP (C#) lexer styles
            scintilla.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
            scintilla.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green
            scintilla.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green
            scintilla.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
            scintilla.Styles[Style.Cpp.Number].ForeColor = Color.Olive;
            scintilla.Styles[Style.Cpp.Word].ForeColor = Color.Blue;
            scintilla.Styles[Style.Cpp.Word2].ForeColor = Color.Blue;
            scintilla.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red
            scintilla.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red
            scintilla.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red
            scintilla.Styles[Style.Cpp.StringEol].BackColor = Color.Pink;
            scintilla.Styles[Style.Cpp.Operator].ForeColor = Color.Purple;
            scintilla.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon;
            scintilla.Lexer = Lexer.Cpp;

            if (true)
            {
                BackColor = Color.FromArgb(0, 0, 0);
                this.progressBar.BackColor = BackColor;
                scintilla.Styles[Style.Default].ForeColor = Color.Silver;
                scintilla.Styles[Style.Default].BackColor = Color.FromArgb(30, 30, 30);
                scintilla.CaretForeColor = Color.Silver;
                scintilla.SetSelectionBackColor(true, Color.FromArgb(50, 80, 140));

                scintilla.StyleClearAll();
                scintilla.Styles[Style.IndentGuide].BackColor = Color.FromArgb(50, 50, 50);
                scintilla.Styles[Style.IndentGuide].ForeColor = Color.FromArgb(50, 50, 50);

                // Configure the CPP (C#) lexer styles
                scintilla.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
                scintilla.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green
                scintilla.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green
                scintilla.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
                scintilla.Styles[Style.Cpp.Number].ForeColor = Color.Olive;
                scintilla.Styles[Style.Cpp.Word].ForeColor = Color.CornflowerBlue;
                scintilla.Styles[Style.Cpp.Word2].ForeColor = Color.CornflowerBlue;
                scintilla.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red
                scintilla.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red
                scintilla.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red
                scintilla.Styles[Style.Cpp.StringEol].BackColor = Color.Pink;
                scintilla.Styles[Style.Cpp.Operator].ForeColor = Color.Purple;
                scintilla.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon;
                scintilla.Lexer = Lexer.Cpp;
            }

            //scintilla.Margins[1].Width = 0;
            scintilla.Margins[1].Type = MarginType.BackColor;
            //scintilla.Margins[0].Width = 16;
        }
开发者ID:devigned,项目名称:autorest,代码行数:57,代码来源:AutoRestPreviewForm.cs

示例3: MainForm

        /// <summary>
        /// Ctor
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            //Init Scintilla Component
            m_scintillaCtrl = new Scintilla();

            m_scintillaCtrl.Parent = panelTextEditor;
            m_scintillaCtrl.Dock = DockStyle.Fill;
            m_scintillaCtrl.Margins[0].Width = 16;
            m_scintillaCtrl.TabWidth = 2;

            // Configuring the default style with properties
            // we have common to every lexer style saves time.
            m_scintillaCtrl.StyleResetDefault();
            m_scintillaCtrl.Styles[Style.Default].Font = "Consolas";
            m_scintillaCtrl.Styles[Style.Default].Size = 10;
            m_scintillaCtrl.Styles[Style.Default].BackColor = Color.FromArgb(219, 227, 227);
            m_scintillaCtrl.StyleClearAll();

            // Configure the lexer styles
            m_scintillaCtrl.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
            m_scintillaCtrl.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green
            m_scintillaCtrl.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green
            m_scintillaCtrl.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
            m_scintillaCtrl.Styles[Style.Cpp.Number].ForeColor = Color.Olive;
            m_scintillaCtrl.Styles[Style.Cpp.Word].ForeColor = Color.Blue;
            m_scintillaCtrl.Styles[Style.Cpp.Word2].ForeColor = Color.Blue;
            m_scintillaCtrl.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red
            m_scintillaCtrl.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red
            m_scintillaCtrl.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red
            m_scintillaCtrl.Styles[Style.Cpp.StringEol].BackColor = Color.Pink;
            m_scintillaCtrl.Styles[Style.Cpp.Operator].ForeColor = Color.Purple;
            m_scintillaCtrl.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon;

            m_scintillaCtrl.Lexer = Lexer.Cpp;


            //Create keywords for HLSL
            StringBuilder sb = new StringBuilder();
            var map = new EnumMap<ShaderToken>();
            map.Load("HLSLKeywords.map");
            foreach (var kw in map)
            {
                var str = kw.Key + " ";

                if (str[0] == ':')
                    str = str.Substring(1);

                sb.Append(str);
            }
            m_scintillaCtrl.SetKeywords(0, sb.ToString());

            //MRU
            mruMenu = new MruStripMenuInline(fileToolStripMenuItem, recentFilesToolStripMenuItem, new MruStripMenu.ClickedHandler(OnMruFile), mruRegKey + "\\MRU", 16);
            mruMenu.LoadFromRegistry();
        }
开发者ID:procfxgen,项目名称:MGShaderEditor,代码行数:60,代码来源:MainForm.cs

示例4: addTab

        private int addTab()
        {

            TabPage tab = new TabPage("Untitled        X");
            Scintilla body = new Scintilla();
            file_name.Add(null);
            ismodified.Add(false);
            hasstar.Add(false);
            charcount.Add(0);
            tabcount.Add(0);

            body.Name = "body";
            body.Anchor = (AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom);
            body.Margins[0].Width = 16;

            // Configuring the default style with properties
            // we have common to every lexer style saves time.
            body.StyleResetDefault();
            body.Styles[Style.Default].Font = "Manillo";
            body.Styles[Style.Default].Size = 10;
            body.Styles[Style.Default].BackColor = BackColorVar;
            body.Styles[Style.Default].ForeColor = ForeColorVar;
            body.StyleClearAll();

            if (Properties.Settings.Default.DarkMode == true)
            {
                //DARK MODE SYNTAX HIGHLIGHTING SETTING
                body.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(87, 166, 74); // Green
                body.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(87, 166, 74); // Green
                body.Styles[Style.Cpp.Word].ForeColor = Color.FromArgb(38, 139, 210); //Blue
                body.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(220, 50, 47); // Red
                body.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(220, 50, 47); // Red
                body.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(220, 50, 47); // Red
            }
            else if (Properties.Settings.Default.DarkMode == false)
            {
                //LIGHT MODE SYNTAX HIGHLIGHTING SETTINGS
                body.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green
                body.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green
                body.Styles[Style.Cpp.Word].ForeColor = Color.Blue;
                body.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red
                body.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red
                body.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red
            }

            // Configure the CPP (C#) lexer styles
            body.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
            body.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
            body.Styles[Style.Cpp.Number].ForeColor = Color.Olive;
            body.Styles[Style.Cpp.Word2].ForeColor = Color.Magenta;
            body.Styles[Style.Cpp.StringEol].BackColor = Color.Pink;
            body.Styles[Style.Cpp.Operator].ForeColor = Color.Purple;
            body.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Maroon;
            body.IndentationGuides = IndentView.LookBoth;
            body.Styles[Style.BraceLight].BackColor = Color.LightGray;
            body.Styles[Style.BraceLight].ForeColor = Color.BlueViolet;
            body.Styles[Style.BraceBad].ForeColor = Color.Red;
            body.Styles[Style.LineNumber].BackColor = BackColorVar;
            body.Lexer = Lexer.Cpp;

            // Set the keywords. 0 is functions, 1 is variables
            body.SetKeywords(0, Keywords.Key0());
            body.SetKeywords(1, Keywords.Key1());

            body.CaretLineBackColor = Color.White;
            body.CaretForeColor = ForeColorVar;

            body.CharAdded += new System.EventHandler<ScintillaNET.CharAddedEventArgs>(this.scintilla_CharAdded);
            body.UpdateUI += new System.EventHandler<ScintillaNET.UpdateUIEventArgs>(this.scintilla_UpdateUI);
            body.TextChanged += new System.EventHandler(this.scintilla_TextChanged);
            body.KeyDown += new System.Windows.Forms.KeyEventHandler(this.scintilla_KeyDown);

            body.BeginUndoAction();
            body.IndentWidth = 0;

            tab.Controls.Add(body);
            tabControl1.TabPages.Add(tab);
            int i = tabControl1.TabCount - 1;
            tabControl1.SelectedIndex = i;
            return i;
        }
开发者ID:TN-1,项目名称:Kode_Desktop,代码行数:81,代码来源:Form1.cs

示例5: _SetStyles

        private void _SetStyles(Scintilla ed)
        {
            ed.Lexer = Lexer.Sql;
            ed.StyleResetDefault();
            ed.Styles[ScintillaNET.Style.Default].Font = "Consolas";
            ed.Styles[ScintillaNET.Style.Default].Size = 10;
            ed.StyleClearAll();

            ed.Styles[ScintillaNET.Style.Default].ForeColor = System.Drawing.Color.Silver;
            ed.Styles[ScintillaNET.Style.Sql.Comment].ForeColor = System.Drawing.Color.ForestGreen;
            ed.Styles[ScintillaNET.Style.Sql.CommentLine].ForeColor = System.Drawing.Color.ForestGreen;
            ed.Styles[ScintillaNET.Style.Sql.Identifier].ForeColor = System.Drawing.Color.CornflowerBlue;
            ed.Styles[ScintillaNET.Style.Sql.Operator].ForeColor = System.Drawing.Color.Maroon;
            ed.Styles[ScintillaNET.Style.Sql.Word].ForeColor = System.Drawing.Color.DarkOrange;
            ed.Styles[ScintillaNET.Style.Sql.Number].ForeColor = System.Drawing.Color.IndianRed;

            ed.SetKeywords(0, @"absolute action add admin after aggregate
            alias all allocate alter and any are array as asc
            assertion at authorization
            before begin binary bit blob body boolean both breadth by
            call cascade cascaded case cast catalog char character
            check class clob close collate collation column commit
            completion connect connection constraint constraints
            constructor continue corresponding create cross cube current
            current_date current_path current_role current_time current_timestamp
            current_user cursor cycle
            data date day deallocate dec decimal declare default
            deferrable deferred delete depth deref desc describe descriptor
            destroy destructor deterministic dictionary diagnostics disconnect
            distinct domain double drop dynamic
            each else end end-exec equals escape every except
            exception exec execute exists exit external
            false fetch first float for foreign found from free full
            function
            general get global go goto grant group grouping
            having host hour
            identity if ignore immediate in indicator initialize initially
            inner inout input insert int integer intersect interval
            into is isolation iterate
            join
            key
            language large last lateral leading left less level like
            limit local localtime localtimestamp locator
            map match merge minute modifies modify module month
            names national natural nchar nclob new next no none
            not null numeric
            object of off old on only open operation option
            or order ordinality out outer output
            package pad parameter parameters partial path postfix precision prefix
            preorder prepare preserve primary
            prior privileges procedure public
            read reads real recursive ref references referencing relative
            restrict result return returns revoke right
            role rollback rollup routine row rows
            savepoint schema scroll scope search second section select
            sequence session session_user set sets size smallint some| space
            specific specifictype sql sqlexception sqlstate sqlwarning start
            state statement static structure system_user
            table temporary terminate than then time timestamp
            timezone_hour timezone_minute to trailing transaction translation
            treat trigger true
            under union unique unknown
            unnest update usage user using
            value values varchar variable varying view
            when whenever where with without work write
            year
            zone
            all alter and any array as asc at authid avg begin between
            binary_integer
            body boolean bulk by char char_base check close cluster collect
            comment commit compress connect constant create current currval
            cursor date day declare decimal default delete desc distinct
            do drop else elsif end exception exclusive execute exists exit
            extends false fetch float for forall from function goto group
            having heap hour if immediate in index indicator insert integer
            interface intersect interval into is isolation java level like
            limited lock long loop max min minus minute mlslabel mod mode
            month natural naturaln new nextval nocopy not nowait null number
            number_base ocirowid of on opaque open operator option or order
            organization others out package partition pctfree pls_integer
            positive positiven pragma prior private procedure public raise
            range raw real record ref release return reverse rollback row
            rowid rownum rowtype savepoint second select separate set share
            smallint space sql sqlcode sqlerrm start stddev subtype successful
            sum synonym sysdate table then time timestamp to trigger true
            type uid union unique update use user validate values varchar
            varchar2 variance view when whenever where while with work write
            year zone");
        }
开发者ID:FungusHumungus,项目名称:sqlrefactor,代码行数:89,代码来源:MainWindow.xaml.cs


注:本文中的ScintillaNET.Scintilla.StyleResetDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。