Exemplo n.º 1
0
        static TextEditorViewType()
        {
            PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));

            if (propertyService != null)
            {
                //实例化一个高亮度显示语法的对象.(该对象包含各种文件的高亮度显示策略)
                SyntaxModeProvider syntaxModeProvider = new SyntaxModeProvider(Path.Combine(propertyService.DataDirectory, "modes"));

                HighlightingManager.Manager.AddSyntaxModeProvider(syntaxModeProvider);                //添加一个语法醒目显示提供者.
            }
        }
Exemplo n.º 2
0
        public void InitializeData()
        {
            //conn.ConnectionString = @"server=tangxuehua\netsdk;database=communityserver;user id=sa;password="******"server=" + serverName + ";database=" + databaseName + ";user Id=" + userName + ";password="******"select name from sysobjects where xtype = 'u' and status >= 0 order by name";
                apt.Fill(ds1);


                cmd.CommandText = "select name from sysobjects where xtype = 'p' and status >= 0 order by name";
                apt.Fill(ds2);

                BindToTableDataGrid();
                BindToSourceProcedureDataGrid();

                SyntaxModeProvider syntaxModeProvider = new SyntaxModeProvider(Path.Combine(Application.StartupPath, @"modes"));

                HighlightingManager.Manager.AddSyntaxModeProvider(syntaxModeProvider);

                tempTable.Columns.Add(new DataColumn("procedureName", typeof(string)));
                ds3.Tables.Add(tempTable);

                tempTable1.Columns.Add(new DataColumn("procedureName", typeof(string)));

                DeleteAllFiles();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                Application.Exit();
            }
        }