public virtual void HighlightSyntax(string word, NSRange range) {
try {
// Found a keyword?
KeywordDescriptor info;
if (Language.Keywords.TryGetValue(word,out info)) {
// Yes, adjust attributes
TextEditor.LayoutManager.SetTemporaryAttributes(new NSDictionary(NSStringAttributeKey.ForegroundColor, info.Color),range);
} else {
TextEditor.LayoutManager.RemoveTemporaryAttribute(NSStringAttributeKey.ForegroundColor,range);
}
} catch {
// Ignore any exceptions at this point
}
}