Hack Forums
[.NET] Syntax highlighting [ Read ] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Syntax highlighting [ Read ] (/showthread.php?tid=4652880)



Syntax highlighting [ Read ] - Spawner10 - Jan 24, 2015

So i have the Source code of 'FASTCOLOREDTEXTBOX' and i want to make my own Syntax .

So ...
what i'm trying to do :
  • Read all keywords from the Resource ( .txt file )

  • add it as a Changed style



so in the actually code its like this

Code
e.ChangedRange.SetStyle(BlueStyle, "\b(if|as|base|bool|break|byte|case|,|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b|#region\b|#endregion\b")

i want

to read my text resource

lets be more clear my text file include some words like this :
init_file
init_do
init_x
init_x2

and to read it and paste it as a change style in the regex


* - nathan72389 - Jan 24, 2015

where is the fucking question?

look... ? <-- its a fucking question mark.
where is yours?


* - Spawner10 - Jan 24, 2015

( Let me retry )

how to read a resource and parse the contents in the e.ChangedRange.SetStyle ?

did you understand me ? <- this was a fucking question !


* - Rhez - Jan 25, 2015

(Jan 24, 2015 05:49 PM)Spawner10 Wrote:  ( Let me retry )

how to read a resource and parse the contents in the e.ChangedRange.SetStyle ?

did you understand me ? <- this was a fucking question !

stupidSyntax.txt
Code
I|fuck|your|mom

PHP Code

<?php 
Dim txt 
As String() = Split(File.ReadAllText("C:\stupidSyntax.txt"), "|")
e.ChangedRange.SetStyle(BlueStyle, txt) 

Maybe my simple logic will help you.
🤗

- It's me Rhez


* - Spawner10 - Jan 25, 2015

Thanks Rhez ^_^ ! This is the good one !