本文整理汇总了C#中Engine.Evaluate方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.Evaluate方法的具体用法?C# Engine.Evaluate怎么用?C# Engine.Evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.Evaluate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
panel1.Visible = true;
engine = new Engine();
engine.Flag = Engine.ExecutanFlags.RamOptimized;
engine.Evaluate(fastColoredTextBox1.Text);
fastColoredTextBox1.Text =
fastColoredTextBox1.Text.Replace(
"Console.WriteLine(\"hello world\"); #gets replaced by msg box in load event",
"MessageBox.Show(\"hello world\");");
listBox1.Items.Clear();
if (ShowConsole == false)
panel1.Visible = false;
var items = new List<AutocompleteItem>();
items.Add(new MethodAutocompleteItem2("Console.WriteLine"));
items.Add(new SnippetAutocompleteItem("if ^[expression]\r\n\r\t#do something\nend if"));
items.Add(new SnippetAutocompleteItem("try \r\n\r^#do something\n\rcatch ex\r\n#do something\n\nfinally\n#do something\nend try"));
items.Add(new SnippetAutocompleteItem("switch ^parent \r\n\r#do something\ncase condition:\r\n#do something\nbreak;\ndefault:\n#do something\nend switch"));
foreach (var node in AddinManager.GetExtensionObjects("/EcIDE/Intellisense/Snippets"))
{
var cmd = node.CreateInstances<ISnippet>();
Array.ForEach(cmd, c => items.Add(new SnippetAutocompleteItem(c.GetSnippet())));
}
foreach (var node in AddinManager.GetExtensionObjects("/EcIDE/Intellisense/Commands"))
{
var cmd = node.CreateInstances<IIntellisenseCommand>();
foreach (var intellisenseCommand in cmd)
{
StyleManager.Add(intellisenseCommand.GetPattern(), intellisenseCommand.GetColor(), intellisenseCommand.GetStyle());
InfoManager.Add(intellisenseCommand.GetPattern(), intellisenseCommand.GetDescription());
items.Add(new AutocompleteItem(intellisenseCommand.GetPattern(), 0));
}
}
var menu = new AutocompleteMenu(fastColoredTextBox1);
menu.SearchPattern = @"[\w\.]";
menu.AllowTabKey = true;
menu.ImageList = imageList1;
menu.Items.SetAutocompleteItems(items);
}
示例2: startToolStripMenuItem_Click
private void startToolStripMenuItem_Click(object sender, EventArgs e)
{
panel1.Visible = true;
engine = new Engine();
engine.Flag = Engine.ExecutanFlags.RamOptimized | Engine.ExecutanFlags.Strict;
engine.Evaluate(fastColoredTextBox1.Text);
foreach (var error in engine.Errors)
{
Console.WriteLine(error.Message);
}
panel1.Visible = ShowConsole;
}
示例3: MainForm_Load
private void MainForm_Load(object sender, EventArgs e)
{
var startwindow = new DocumentWindow();
startwindow.Text = "StartPage";
startwindow.Controls.Add(new StartPageCtrl() {Dock = DockStyle.Fill});
dock.AddDocument(startwindow);
/* var pf = new ProjectFile();
pf.Body.Properties.Add("Version", "1.0.0.0");
pf.ProjectHeader = new Header() { Name = "TestProject", Type = ProjectType.WindowsFormsApplication };
ProjectFile.Save("test.ecproj", ref pf);*/
if (File.Exists("dock.xml"))
{
// this.radDock1.LoadFromXml("dock.xml");
}
engine = new Engine { Flag = Engine.ExecutanFlags.RamOptimized };
engine.Evaluate(this.fastColoredTextBox1.Text);
console.Clear();
if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
{
var updController = new updateController
{
updateUrl = "http://eclang.tk/updates/",
projectId = "8ffc8e6d-93d9-4bc2-a48e-238f27efae9e",
publicKey =
"<RSAKeyValue><Modulus>z6FnsZcLX3Cl864s1x/8fR8/Mg1kIJIiFBouMUdRpMxe13t5J/B4S3obzr94oQgjiXR/09vjKUQdoAsUm1AwxjI+7TkR3TEnu2HHEw2O8e4gkbfnwHqODtSWuHzsIxFnhhYcmVWfY/eRniilfnUBb6bcVomFUxwQFfAqXl8vC58iVjIW+4Ir05qTTH3KIf24J+ADoLYuX0rQD6wCdfmWCII7QuqkN7NBfmoq1G2Ol5p366ILnANMdz+3n+u6lkkjl+RVEAoG/pDaRIbSnb52k0p517Cb1N4D3zfr3cftYLKQImDAc9xtC9V8F2nVdjTz05pooZuONrg8J7lmwkYER1+xDnzAg4hL0g2jefjsbrlUuvs0/nIff8DKGsqkAzg/Qg5ylYdQ/lrge6tdISrIql1PZY6qo6VlllCDn8yLhpdZfUuBMEdVrW0xLo7qWZ8Y9dHsO2It52BtvAtEpKwwPOLyL9PTU+A9DnbdSgVckdDye8dVgcZeApsrIf1qWRJyqcdXjP9Y4pKefYcBizCIjL4gGUQilR5I7WsqXfAwPkqEcWCPtaBrX8jb9JmGqY0aUH7FDYdoK0kmkaM2PGiSMaugTnfcs0HUFStj4Liaz7I0b3zM+sN7sx/dW/0KYDXCNZWVxFndcG9aZk/0umaA7q+ISITadaY+axa3DsVwelU=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>",
releaseFilter =
{
checkForFinal = true,
checkForBeta = true,
checkForAlpha = true
},
restartApplication = true,
autoCloseHostApplication = true,
retrieveHostVersion = true,
Language = Languages.Auto
};
if (updController.checkForUpdates()) updController.updateInteractive(this);
}
}