Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
WalkerMx authored Sep 11, 2020
1 parent 0b58df1 commit 6c82dfc
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 26 deletions.
1 change: 1 addition & 0 deletions AutoCrispy/AutoCrispy/AutoCrispy.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
Expand Down
71 changes: 48 additions & 23 deletions AutoCrispy/AutoCrispy/EditChainDialog.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion AutoCrispy/AutoCrispy/EditChainDialog.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Public Class EditChainDialog
Imports System.Text.RegularExpressions

Public Class EditChainDialog

Public Property InternalText As String
Public Property ResultText As String
Expand All @@ -9,6 +11,10 @@
EditTextBox.Text = Xml
End Sub

Public Sub EditChainDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Colorize(EditTextBox, Color.DarkBlue, Color.Maroon)
End Sub

Private Sub OK_Button_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OK_Button.Click
Me.DialogResult = DialogResult.OK
ResultText = EditTextBox.Text
Expand All @@ -22,6 +28,23 @@

Private Sub Reset_Button_Click(sender As Object, e As EventArgs) Handles Reset_Button.Click
EditTextBox.Text = InternalText
Colorize(EditTextBox, Color.DarkBlue, Color.Maroon)
End Sub

Private Sub Colorize(ByRef PlainTextBox As RichTextBox, TagColor As Color, QuoteColor As Color)
Dim TagMatches = Regex.Matches(PlainTextBox.Text, "(?<=<)(.*?)(?=>)", RegexOptions.Compiled)
For Each TagMatch As Match In TagMatches
PlainTextBox.Select(TagMatch.Index, TagMatch.Length)
PlainTextBox.SelectionColor = TagColor
Next
Dim QuoteMatches = Regex.Matches(PlainTextBox.Text, "\" & ControlChars.Quote & "(.*?)" & "\" & ControlChars.Quote, RegexOptions.Compiled)
For Each QuoteMatch As Match In QuoteMatches
If Not QuoteMatch.Value.Contains("="c) Then
PlainTextBox.Select(QuoteMatch.Index, QuoteMatch.Length)
PlainTextBox.SelectionColor = QuoteColor
End If
Next
PlainTextBox.Select(0, 0)
End Sub

End Class
1 change: 1 addition & 0 deletions AutoCrispy/AutoCrispy/Form1.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AutoCrispy/AutoCrispy/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.2.3")>
<Assembly: AssemblyFileVersion("1.0.2.3")>
<Assembly: AssemblyVersion("1.0.2.4")>
<Assembly: AssemblyFileVersion("1.0.2.4")>

0 comments on commit 6c82dfc

Please sign in to comment.