[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
不懂winform,简单弄了下,机器太旧测试不了,不知道行不行,你自己试试看吧,出现找不到类型之类的自己尝试添加下winform或drawing或ScintillaNET.dll
  1. Add-Type -Path "$home\Desktop\EasyScintilla.dll"
  2. $batcode=@'
  3. @echo off
  4. set p=c:
  5. for /f "tokens=*" %%i in ('wmic logicaldisk where "name='%p%'" get DriveType^,Description^,name  /value') do (
  6.      for /f "tokens=*" %%j in ("%%i") do set %%j
  7. )
  8. echo %name%  %Description%
  9. pause
  10. '@
  11. $pscode=@'
  12. $st = Get-Date   #脚本开头
  13. Get-Process
  14. $et = Get-Date   #脚本结尾
  15. ($et - $st).TotalSeconds   #计算
  16. '@
  17. #不懂ps函数,弄成块了
  18. $easysci={
  19. param($thetext,$thetype)
  20. #编辑器设置
  21. $editor=[EasyScintilla.SimpleEditor]::new()
  22. $editor.Anchor = ([System.Windows.Forms.AnchorStyles](((([System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.AnchorStyles]::Bottom) -bor [System.Windows.Forms.AnchorStyles]::Left) -bor [System.Windows.Forms.AnchorStyles]::Right)))
  23. $editor.IndentationGuides = [ScintillaNET.IndentView]::LookBoth
  24. $editor.Location = [System.Drawing.Point]::new(12, 12)
  25. $editor.Name = "editor"
  26. $editor.Size = [System.Drawing.Size]::new(854, 603)
  27. #$editor.Styler = $null
  28. if($thetype -eq "C#"){$editor.Styler=[EasyScintilla.Stylers.CSharpStyler]::new()}
  29. if($thetype -eq "C# (Dark)"){$editor.Styler=[EasyScintilla.Stylers.DarkCSharpStyler]::new()}
  30. if($thetype -eq "Windows Batch"){$editor.Styler=[EasyScintilla.Stylers.BatchStyler]::new()}
  31. if($thetype -eq "HTML"){$editor.Styler=[EasyScintilla.Stylers.HtmlStyler]::new()}
  32. if($thetype -eq "JSON"){$editor.Styler=[EasyScintilla.Stylers.JsonStyler]::new()}
  33. if($thetype -eq "PowerShell"){$editor.Styler=[EasyScintilla.Stylers.PowerShellStyler]::new()}
  34. if($thetype -eq "Python"){$editor.Styler=[EasyScintilla.Stylers.PythonStyler]::new()}
  35. if($thetype -eq "Ruby"){$editor.Styler=[EasyScintilla.Stylers.RubyStyler]::new()}
  36. if($thetype -eq "T-SQL"){$editor.Styler=[EasyScintilla.Stylers.SqlStyler]::new()}
  37. if($thetype -eq "Teradata Parallel Transporter"){$editor.Styler=[EasyScintilla.Stylers.TptStyler]::new()}
  38. $editor.Text=$thetext
  39. $editor.TabIndex = 0
  40. #窗体设置
  41. $theform=[System.Windows.Forms.Form]::new()
  42. $theform.SuspendLayout()
  43. $theform.AutoScaleDimensions=[System.Drawing.SizeF]::new(6, 13)
  44. $theform.AutoScaleMode=[System.Windows.Forms.AutoScaleMode]::font
  45. $theform.ClientSize=[System.Drawing.Size]::new(878, 656)
  46. $theform.Controls.Add($editor)
  47. $theform.Name = "Form1"
  48. $theform.Text = "EasyScintilla Test App"
  49. $theform.ResumeLayout($false)
  50. #显示窗体,模态
  51. $theform.ShowDialog()
  52. #清空
  53. $editor=$null
  54. $theform.Dispose()
  55. $theform=$null
  56. #返回
  57. return 0
  58. }
  59. #调用块,参数1为文本字符串,参数2为语言样式字符串
  60. $easysci.Invoke($batcode,'Windows Batch')
  61. #$easysci.Invoke($pscode,'PowerShell')
复制代码
1

评分人数

TOP

回复 7# 小白龙

在外面添加一个变量,清空前(第59行前)将$editor.Text赋值给这个变量,然后使用这个变量

TOP

Program.cs   是执行程序代码
Form1.cs   界面交互代码
Form1.Designer.cs 界面设计代码
这三个文件基本上是可以并一起的,只要调整下那些using

至于弄成你说的类库,参考下面的,C#跟winform都只是略懂毛毛雨,不知对不对
EasySci函数(第123行)定义在Nakano类(第105行)中
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using EasyScintilla.Stylers;
  11. using System.IO;
  12. using System.Reflection;
  13. namespace ExampleProject
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         private EasyScintilla.SimpleEditor editor;//编辑器声明
  18.         private System.Windows.Forms.Button theButton;//按钮声明
  19.         private String thertStr //返回字符串声明
  20.          ///<summary>
  21.         /// Required designer variable.
  22.         /// </summary>
  23.         private System.ComponentModel.IContainer components = null;
  24.         /// <summary>
  25.         /// Clean up any resources being used.
  26.         ///重定义Form1释放函数
  27.         /// </summary>
  28.         /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  29.         protected override void Dispose(bool disposing)
  30.         {
  31.             if (disposing && (components != null))
  32.             {
  33.                 components.Dispose();
  34.             }
  35.             base.Dispose(disposing);
  36.         }
  37.         //定义Form1关闭事件函数,用于关闭时储存编辑器文本
  38.         private void Form1_Closing(object sender, EventArgs e){thertStr=editor.Text;}
  39.         //Form1构造函数
  40.         public Form1()
  41.         {
  42.             InitializeComponent();//调用初始化函数
  43.         }
  44.         #region Windows Form Designer generated code
  45.         /// <summary>
  46.         /// Required method for Designer support - do not modify
  47.         /// the contents of this method with the code editor.
  48.         ///初始化函数定义
  49.         /// </summary>
  50.         private void InitializeComponent()
  51.         {
  52.             this.editor = new EasyScintilla.SimpleEditor();//创建编辑器
  53.             this.theButton = new System.Windows.Forms.Button();//创建按钮
  54.             this.SuspendLayout();
  55.             //
  56.             // editor设置
  57.             //
  58.             this.editor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  59.             | System.Windows.Forms.AnchorStyles.Left)
  60.             | System.Windows.Forms.AnchorStyles.Right)));
  61.             this.editor.IndentationGuides = ScintillaNET.IndentView.LookBoth;
  62.             this.editor.Location = new System.Drawing.Point(12, 12);
  63.             this.editor.Name = "editor";
  64.             this.editor.Size = new System.Drawing.Size(854, 603);
  65.             this.editor.Styler = null;
  66.             this.editor.TabIndex = 0;
  67.             //
  68.             // 按钮设置
  69.             //
  70.             this.theButton.Size=new System.Drawing.Size(100, 21);
  71.             this.theButton.Location=new System.Drawing.Point(12, 621);
  72.             this.theButton.Name="button1";
  73.             this.theButton.Text="OK";
  74.             //
  75.             // Form1设置
  76.             //
  77.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  78.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  79.             this.ClientSize = new System.Drawing.Size(878, 656);
  80.             this.Controls.Add(this.theButton);//添加按钮到Form1
  81.             this.Controls.Add(this.editor);//添加编辑器到Form1
  82.             this.Name = "Form1";
  83.             this.Text = "EasyScintilla Test App";
  84.             //this.Load += new System.EventHandler(this.Form1_Load);
  85.             this.Closing += new System.EventHandler(this.Form1_Closing);//添加关闭事件
  86.             this.ResumeLayout(false);
  87.         }
  88.         #endregion
  89.     }
  90. //========================================
  91. //========================================
  92. public class Nakano{
  93. //语言样式字段
  94. private Hashtable _theStyler=new Hashtable();
  95. _theStyler.Add("C#", new CSharpStyler());
  96. _theStyler.Add("C# (Dark)", new DarkCSharpStyler());
  97. _theStyler.Add("Windows Batch" new BatchStyler());
  98. _theStyler.Add("HTML",  new HtmlStyler());
  99. _theStyler.Add("JSON",  new JsonStyler());
  100. _theStyler.Add("PowerShell",  new PowerShellStyler());
  101. _theStyler.Add("Python", new PythonStyler());
  102. _theStyler.Add("Ruby", new RubyStyler());
  103. _theStyler.Add("T-SQL", new SqlStyler());
  104. _theStyler.Add("Teradata Parallel Transporter", new TptStyler());
  105. //语言样式属性
  106. public static Hashtable TheStyler{get {return _theStyler;}}
  107. public static string EasySci (string code, string codeType)
  108. {
  109. var theForm1=new Form1();
  110. string theStr='';
  111. if(_theStyler.ContainsKey(codeType))
  112. {
  113. theForm1.editor.Styler=_theStyler[codeType];
  114. }
  115. theForm1.editor.Text=code;
  116. theForm1.ShowDialog();
  117. theStr=new String(theForm1.thertStr);
  118. theForm1.Dispose();
  119. return theStr;
  120. }
  121. }
  122. //========================================
  123. //========================================
  124. }
复制代码

TOP

试试原来108行后面所有换成下面的
  1. private static Hashtable _theStyler=new Hashtable();
  2. private static int _initiga=0;
  3. private static void theInit(){
  4. _theStyler.Add("C#", new CSharpStyler());
  5. _theStyler.Add("C# (Dark)", new DarkCSharpStyler());
  6. _theStyler.Add("Windows Batch" ,new BatchStyler());
  7. _theStyler.Add("HTML",  new HtmlStyler());
  8. _theStyler.Add("JSON",  new JsonStyler());
  9. _theStyler.Add("PowerShell",  new PowerShellStyler());
  10. _theStyler.Add("Python", new PythonStyler());
  11. _theStyler.Add("Ruby", new RubyStyler());
  12. _theStyler.Add("T-SQL", new SqlStyler());
  13. _theStyler.Add("Teradata Parallel Transporter", new TptStyler());
  14. }
  15. //语言样式属性
  16. public static Hashtable TheStyler{
  17. get {
  18. if(_initiga==0){theInit();_initiga=1;return _theStyler;}
  19. return _theStyler;}}
  20. public static string EasySci (string code, string codeType)
  21. {
  22. if(_initiga==0){_initiga=1;theInit();}
  23. var theForm1=new Form1();
  24. StringBuilder theStr;
  25. if(_theStyler.ContainsKey(codeType))
  26. {
  27. theForm1.editor.Styler=_theStyler[codeType];
  28. }
  29. theForm1.editor.Text=code;
  30. theForm1.ShowDialog();
  31. theStr=new StringBuilder(theForm1.thertStr);
  32. theForm1.Dispose();
  33. return theStr.ToString();
  34. }
  35. }
  36. //========================================
  37. //========================================
  38. }
复制代码

TOP

代码编译依赖 EasyScintilla.dll , 编译运行后也依赖 EasyScintilla.dll
EasyScintilla.dll 运行依赖 ScintillaNET.dll
ScintillaNET.dll 运行依赖 SciLexer.dll (大概)

按理来说改成
(ScintillaStyler)_theStyler[codeType];
和那些 public XXX
应该能通过编译的

TOP

回复 21# 小白龙

试试开头再加上一句
using EasyScintilla:

TOP

回复 21# 小白龙
你用的啥编译的?最好发下编译错误的图来看看

TOP

回复 23# Five66

看路径,你的SciLexer.dll是应该是32位的,试试编译32位的

TOP

回复 25# 小白龙
那就编译成32位的,用自带的C#编译器试了下,能成功编译成dll

编译编译命令为(csc改成自己系统的csc路径)
  1. csc  /r:EasyScintilla.dll /r:ScintillaNET.dll /target:library "new 1"
复制代码
代码文件"new 1"跟 EasyScintilla.dll 和 ScintillaNET.dll 放在同一文件夹(只有这3个文件)

还有代码文件改了下,看下面的
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using EasyScintilla.Stylers;
  12. using EasyScintilla;
  13. using System.IO;
  14. using System.Reflection;
  15. namespace ExampleProject
  16. {
  17.     public partial class Form1 : Form
  18.     {
  19.         public EasyScintilla.SimpleEditor editor;//编辑器声明
  20.         public System.Windows.Forms.Button theButton;//按钮声明
  21.         public String thertStr; //返回字符串声明
  22.          ///<summary>
  23.         /// Required designer variable.
  24.         /// </summary>
  25.         private System.ComponentModel.IContainer components = null;
  26.         /// <summary>
  27.         /// Clean up any resources being used.
  28.         ///重定义Form1释放函数
  29.         /// </summary>
  30.         /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  31.         protected override void Dispose(bool disposing)
  32.         {
  33.             if (disposing && (components != null))
  34.             {
  35.                 components.Dispose();
  36.             }
  37.             base.Dispose(disposing);
  38.         }
  39.         //定义Form1关闭事件函数,用于关闭时储存编辑器文本
  40.         private void Form1_Closing(object sender, EventArgs e){thertStr=editor.Text;}
  41.         //Form1构造函数
  42.         public Form1()
  43.         {
  44.             InitializeComponent();//调用初始化函数
  45.         }
  46.         #region Windows Form Designer generated code
  47.         /// <summary>
  48.         /// Required method for Designer support - do not modify
  49.         /// the contents of this method with the code editor.
  50.         ///初始化函数定义
  51.         /// </summary>
  52.         private void InitializeComponent()
  53.         {
  54.             this.editor = new EasyScintilla.SimpleEditor();//创建编辑器
  55.             this.theButton = new System.Windows.Forms.Button();//创建按钮
  56.             this.SuspendLayout();
  57.             //
  58.             // editor设置
  59.             //
  60.             this.editor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  61.             | System.Windows.Forms.AnchorStyles.Left)
  62.             | System.Windows.Forms.AnchorStyles.Right)));
  63.             this.editor.IndentationGuides = ScintillaNET.IndentView.LookBoth;
  64.             this.editor.Location = new System.Drawing.Point(12, 12);
  65.             this.editor.Name = "editor";
  66.             this.editor.Size = new System.Drawing.Size(854, 603);
  67.             this.editor.Styler = null;
  68.             this.editor.TabIndex = 0;
  69.             //
  70.             // 按钮设置
  71.             //
  72.             this.theButton.Size=new System.Drawing.Size(100, 21);
  73.             this.theButton.Location=new System.Drawing.Point(12, 621);
  74.             this.theButton.Name="button1";
  75.             this.theButton.Text="OK";
  76.             //
  77.             // Form1设置
  78.             //
  79.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  80.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  81.             this.ClientSize = new System.Drawing.Size(878, 656);
  82.             this.Controls.Add(this.theButton);//添加按钮到Form1
  83.             this.Controls.Add(this.editor);//添加编辑器到Form1
  84.             this.Name = "Form1";
  85.             this.Text = "EasyScintilla Test App";
  86.             //this.Load += new System.EventHandler(this.Form1_Load);
  87.             this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);//添加关闭事件
  88.             this.ResumeLayout(false);
  89.         }
  90.         #endregion
  91.     }
  92. //========================================
  93. //========================================
  94. public class Nakano{
  95. //语言样式字段
  96. private static Hashtable _theStyler=new Hashtable();
  97. private static int _initiga=0;
  98. private static void theInit(){
  99. _theStyler.Add("C#", new CSharpStyler());
  100. _theStyler.Add("C# (Dark)", new DarkCSharpStyler());
  101. _theStyler.Add("Windows Batch" ,new BatchStyler());
  102. _theStyler.Add("HTML",  new HtmlStyler());
  103. _theStyler.Add("JSON",  new JsonStyler());
  104. _theStyler.Add("PowerShell",  new PowerShellStyler());
  105. _theStyler.Add("Python", new PythonStyler());
  106. _theStyler.Add("Ruby", new RubyStyler());
  107. _theStyler.Add("T-SQL", new SqlStyler());
  108. _theStyler.Add("Teradata Parallel Transporter", new TptStyler());
  109. }
  110. //语言样式属性
  111. public static Hashtable TheStyler{
  112. get {
  113. if(_initiga==0){theInit();_initiga=1;return _theStyler;}
  114. return _theStyler;}}
  115. public static string EasySci (string code, string codeType)
  116. {
  117. if(_initiga==0){_initiga=1;theInit();}
  118. var theForm1=new Form1();
  119. StringBuilder theStr;
  120. if(_theStyler.ContainsKey(codeType))
  121. {
  122. theForm1.editor.Styler=(ScintillaStyler)_theStyler[codeType];
  123. }
  124. theForm1.editor.Text=code;
  125. theForm1.ShowDialog();
  126. theStr=new StringBuilder(theForm1.thertStr);
  127. theForm1.Dispose();
  128. return theStr.ToString();
  129. }
  130. }
  131. //========================================
  132. //========================================
  133. }
复制代码

TOP

回复 26# Five66

差点忘了,我用32位系统编译的,64位系统建议下载dotnet编译成32位的

TOP

回复 27# Five66

哦不对,是64位,64位系统的csc能成功编译
系统自带的也有32位的编译器,应该能直接用32位编译器编译32位的,不用再装dotnet

TOP

回复 28# 小白龙

不懂com,一点都不懂,更不用说C#的com了,实在无能为力

TOP

回复 31# 小白龙

印象中C#的com还要用代码暴露函数的,反正不懂
我只会用com
不会弄com

TOP

回复 35# 小白龙

因为代码里本来就没有添加按钮的鼠标点击事件,点击后啥都不会做,自己在代码里参考Form1的加上去吧

TOP

回复 34# 小白龙

看了好多网上的com教程,特么全都是用vs的,细节压根就搞不懂
试试照着下面连接来吧
https://www.jianshu.com/p/be7f61ba7c86

新建的名字用 ExampleProject , 自行添加 EasyScintilla.dll 和 ScintillaNET.dll 引用
代码用下面的(第108行起)
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using EasyScintilla.Stylers;
  12. using EasyScintilla;
  13. using System.IO;
  14. using System.Reflection;
  15. using System.Runtime.InteropServices;
  16. namespace ExampleProject
  17. {
  18.     public partial class Form1 : Form
  19.     {
  20.         public EasyScintilla.SimpleEditor editor;//编辑器声明
  21.         public System.Windows.Forms.Button theButton;//按钮声明
  22.         public String thertStr; //返回字符串声明
  23.          ///<summary>
  24.         /// Required designer variable.
  25.         /// </summary>
  26.         private System.ComponentModel.IContainer components = null;
  27.         /// <summary>
  28.         /// Clean up any resources being used.
  29.         ///重定义Form1释放函数
  30.         /// </summary>
  31.         /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  32.         protected override void Dispose(bool disposing)
  33.         {
  34.             if (disposing && (components != null))
  35.             {
  36.                 components.Dispose();
  37.             }
  38.             base.Dispose(disposing);
  39.         }
  40.         //定义Form1关闭事件函数,用于关闭时储存编辑器文本
  41.         private void Form1_Closing(object sender, EventArgs e){thertStr=editor.Text;}
  42.         //Form1构造函数
  43.         public Form1()
  44.         {
  45.             InitializeComponent();//调用初始化函数
  46.         }
  47.         #region Windows Form Designer generated code
  48.         /// <summary>
  49.         /// Required method for Designer support - do not modify
  50.         /// the contents of this method with the code editor.
  51.         ///初始化函数定义
  52.         /// </summary>
  53.         private void InitializeComponent()
  54.         {
  55.             this.editor = new EasyScintilla.SimpleEditor();//创建编辑器
  56.             this.theButton = new System.Windows.Forms.Button();//创建按钮
  57.             this.SuspendLayout();
  58.             //
  59.             // editor设置
  60.             //
  61.             this.editor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  62.             | System.Windows.Forms.AnchorStyles.Left)
  63.             | System.Windows.Forms.AnchorStyles.Right)));
  64.             this.editor.IndentationGuides = ScintillaNET.IndentView.LookBoth;
  65.             this.editor.Location = new System.Drawing.Point(12, 12);
  66.             this.editor.Name = "editor";
  67.             this.editor.Size = new System.Drawing.Size(854, 603);
  68.             this.editor.Styler = null;
  69.             this.editor.TabIndex = 0;
  70.             //
  71.             // 按钮设置
  72.             //
  73.             this.theButton.Size=new System.Drawing.Size(100, 21);
  74.             this.theButton.Location=new System.Drawing.Point(12, 621);
  75.             this.theButton.Name="button1";
  76.             this.theButton.Text="OK";
  77.             //
  78.             // Form1设置
  79.             //
  80.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  81.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  82.             this.ClientSize = new System.Drawing.Size(878, 656);
  83.             this.Controls.Add(this.theButton);//添加按钮到Form1
  84.             this.Controls.Add(this.editor);//添加编辑器到Form1
  85.             this.Name = "Form1";
  86.             this.Text = "EasyScintilla Test App";
  87.             //this.Load += new System.EventHandler(this.Form1_Load);
  88.             this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);//添加关闭事件
  89.             this.ResumeLayout(false);
  90.         }
  91.         #endregion
  92.     }
  93. //========================================
  94. //========================================
  95. [Guid("E2032C8D-2E32-4415-8E8C-CFACBCAAADFF")]
  96. public interface TheCom{
  97. [DispId(1)]
  98. public string EasySci (string code, string codeType);
  99. }
  100. [Guid("BF4EFCF8-8F67-46F2-A84F-E88C8C3DD777"),
  101. ClassInterface(ClassInterfaceType.None)]//,
  102. //ComSourceInterfaces(typeof(TheCom))]
  103. [ProgId("ExampleProject.Application")]
  104. public class Nakano : TheCom{
  105. public string EasySci (string code, string codeType)
  106. {
  107. Hashtable theStyler=new Hashtable();
  108. theStyler.Add("C#", new CSharpStyler());
  109. theStyler.Add("C# (Dark)", new DarkCSharpStyler());
  110. theStyler.Add("Windows Batch" ,new BatchStyler());
  111. theStyler.Add("HTML",  new HtmlStyler());
  112. theStyler.Add("JSON",  new JsonStyler());
  113. theStyler.Add("PowerShell",  new PowerShellStyler());
  114. theStyler.Add("Python", new PythonStyler());
  115. theStyler.Add("Ruby", new RubyStyler());
  116. theStyler.Add("T-SQL", new SqlStyler());
  117. theStyler.Add("Teradata Parallel Transporter", new TptStyler());
  118. var theForm1=new Form1();
  119. StringBuilder theStr;
  120. if(_theStyler.ContainsKey(codeType))
  121. {
  122. theForm1.editor.Styler=(ScintillaStyler)_theStyler[codeType];
  123. }
  124. theForm1.editor.Text=code;
  125. theForm1.ShowDialog();
  126. theStr=new StringBuilder(theForm1.thertStr);
  127. theForm1.Dispose();
  128. return theStr.ToString();
  129. }
  130. }
  131. //========================================
  132. //========================================
  133. }
复制代码

TOP

返回列表