Skip to content

Commit

Permalink
Merge pull request #7 from ryburn52/add-syntax-highlighting
Browse files Browse the repository at this point in the history
Adds Syntax Highlighting
  • Loading branch information
tloten authored Feb 11, 2021
2 parents d45d2a2 + 461d818 commit e5dca1f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions BulkQuery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
<Resource Include="AppIcon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AvalonEdit">
<Version>6.0.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
Expand Down
11 changes: 10 additions & 1 deletion MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@
<StackPanel Margin="5" Orientation="Horizontal" DockPanel.Dock="Bottom">
<Button Name="RunQueryButton" Click="ButtonQuery_OnClick" Padding="10 2">Run Query (F5)</Button>
</StackPanel>
<TextBox x:Name="QueryTextBox" TextWrapping="Wrap" AcceptsReturn="True" FontFamily="Courier New" VerticalScrollBarVisibility="Auto" />
<avalonEdit:TextEditor
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
Name="QueryTextBox"
SyntaxHighlighting="TSQL"
FontFamily="Courier New"
FontSize="10pt"
ShowLineNumbers="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
LineNumbersForeground="#FF2B91AF"/>
</DockPanel>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" DragDelta="RightHandGrid_OnDragDelta" />
<DockPanel Grid.Row="2">
Expand Down
3 changes: 3 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
}
};
DatabasesTreeView.Focus();
// TODO look at adding code completion based on
// https://www.codeproject.com/Articles/42490/Using-AvalonEdit-WPF-Text-Editor
// https://stackoverflow.com/questions/13263046/sql-intellisense-in-wpf-textbox
}

private void SaveSettings()
Expand Down

0 comments on commit e5dca1f

Please sign in to comment.