|
@@ -11,6 +11,7 @@ using System.Windows.Forms;
|
|
|
using CodingCannon.Pages.Basic;
|
|
|
using Microsoft.CodeAnalysis.CSharp;
|
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
|
+using ScintillaNET;
|
|
|
|
|
|
namespace CodingCannon.Pages
|
|
|
{
|
|
@@ -26,16 +27,41 @@ namespace CodingCannon.Pages
|
|
|
{
|
|
|
base.OnHandleCreated(e);
|
|
|
|
|
|
+ scintilla1.Margins[0].Width = 64;
|
|
|
+ scintilla1.Margins[0].Type = MarginType.Number;
|
|
|
|
|
|
- richTextBox1.AllowDrop = true;
|
|
|
- richTextBox1.DragOver += delegate (object? sender, DragEventArgs args)
|
|
|
+ scintilla1.Margins[1].Width = 12;
|
|
|
+ scintilla1.Margins[1].Type = MarginType.Symbol;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ scintilla1.Styles[Style.Default].Size = 16;
|
|
|
+
|
|
|
+
|
|
|
+ scintilla1.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
|
|
|
+ scintilla1.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0);
|
|
|
+ scintilla1.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0);
|
|
|
+ scintilla1.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128);
|
|
|
+ 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);
|
|
|
+ scintilla1.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21);
|
|
|
+ scintilla1.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21);
|
|
|
+ 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;
|
|
|
+
|
|
|
+ scintilla1.AllowDrop = true;
|
|
|
+ scintilla1.DragOver += delegate (object? sender, DragEventArgs args)
|
|
|
{
|
|
|
args.Effect = args.Data.GetDataPresent(DataFormats.FileDrop)
|
|
|
? DragDropEffects.Link
|
|
|
: DragDropEffects.None;
|
|
|
};
|
|
|
|
|
|
- richTextBox1.DragDrop += delegate (object? sender, DragEventArgs args)
|
|
|
+ scintilla1.DragDrop += delegate (object? sender, DragEventArgs args)
|
|
|
{
|
|
|
string[] files;
|
|
|
if (args.Data?.GetDataPresent(DataFormats.FileDrop) != true
|
|
@@ -50,7 +76,9 @@ namespace CodingCannon.Pages
|
|
|
|
|
|
walker.Visit(tree.GetRoot());
|
|
|
|
|
|
- richTextBox1.Text = string.Join(Environment.NewLine, walker.PropertyNames.Select(p => $"t.{p}=f.{p};"));
|
|
|
+ scintilla1.Text = "//Auto generated by Coding Cannon"
|
|
|
+ + Environment.NewLine + Environment.NewLine
|
|
|
+ + string.Join(Environment.NewLine, walker.PropertyNames.Select(p => $"t.{p}=f.{p};"));
|
|
|
};
|
|
|
}
|
|
|
|