コード例 #1
0
ファイル: EventsTestUnits.cs プロジェクト: jeuxjeux20/LeekIDE
        public void IsParenthesisAdded()
        {
            var myEditor = new LeekBox();

            LeekIDE.Autocompletion.Syntaxic.Symbols.AutoCompleteBrackets(myEditor, '(');
            Assert.AreEqual(myEditor.Text, ")");
        }
コード例 #2
0
ファイル: EventsTestUnits.cs プロジェクト: jeuxjeux20/LeekIDE
        public void IsCurlyBracketAdded()
        {
            // this tests if the curly bracket is added :)
            var myEditor = new LeekBox();

            LeekIDE.Autocompletion.Syntaxic.Symbols.AutoCompleteBrackets(myEditor, '{');
            Assert.IsTrue(myEditor.Text.EndsWith("}"));
        }
コード例 #3
0
ファイル: EventsTestUnits.cs プロジェクト: jeuxjeux20/LeekIDE
        public void IsQuoteAdded()
        {
            // this tests if quote is added WITHOUT looping
            var myEditor = new LeekBox();

            // LeekIDE.Autocompletion.Syntaxic.Symbols.AutoCompleteBrackets(myEditor, '"');
            myEditor.TextArea.PerformTextInput("\"");
            Task.Run(async() =>
            {
                await Task.Delay(1500);
                Assert.Fail("timeout :'(");
            });
            Assert.AreEqual(myEditor.Text, "\"\"");
        }
コード例 #4
0
        private async void CommandBinding_Executed_OpenAsync(object sender, ExecutedRoutedEventArgs e)
        {
            var dialog = new OpenFileDialog
            {
                Filter = "LeekScript Files (*.leek)|*.leek|All files (*.*)|*.*"
            };

            if (dialog.ShowDialog() ?? false)
            {
                var item = await LeekBox.CreateBoxFromFileAsync(dialog.FileName);

                var index = Tab.Items.Add(new TabItem
                {
                    Header  = dialog.SafeFileName,
                    Content = item,
                    Style   = Resources["tab"] as Style
                });
            }
        }