erface",
"Is","Let","Lib","Like","Long","Loop","Me","Mod","Module",
"MustInherit","MustOverride","MyBase","MyClass","Namespace","New","Next","Not","Nothing",
"NotInheritable","NotOverridable","Object","On","Option","Optional","Or","OrElse",
"Overloads","Overridable","Overrides","ParamArray","Preserve","Private","Property","Protected","Public",
"RaiseEvent","ReadOnly","ReDim","RemoveHandler","Resume","Return",
"Select","Set","Shadows","Shared","Short","Single","Static","Step","Stop",
"String","Structure","Sub","SyncLock","Then","Throw",
"To","True","Try","TypeOf","Unicode","Until","Variant","When","While",
"With","WithEvents","WriteOnly","Xor"
};
//
//设定转换代码颜色
//
string ReplaceVBComment = TAG_COMMENT + "$1" + TAG_ECOMMENT;
string ReplaceVBKeyword = TAG_FNTBLUE + "${char}" + TAG_EFONT;
//开始转换
for (int i=0;i<VB_Keyword.Length;i++)
{
string TempDirectives = @"(?<char>(\s" + VB_Keyword[i] + "|" + VB_Keyword[i] + @"\s))";
Code = Regex.Replace(Code,TempDirectives,ReplaceVBKeyword,RegexOptions.IgnoreCase);
Code = Regex.Replace(Code,@"''(?<x>[^\r\n]*)",ReplaceVBComment);
Code = Regex.Replace(Code,@"REM (?<x>[^\r\n]*)",ReplaceVBComment);
}
return Code;
}
}
}