本地化SyntaxEditor
SyntaxEditor是一个强大的代码编辑器,提供了语法高亮、自动完成、代码片断等强大功能。
随SyntaxEditor发布的程序集中有一些表单可以直接用于项目,比如FindReplaceForm:
。SyntaxEditor提供了通过编程的方式修改资源文件以达到本地化界面的目的。 方法如下:
ActiproSoftware.Products.SyntaxEditor.AssemblyInfo.Instance.Resources.SetCustomString(key,text);
比如要设置查找\替换对话框的窗口标题,使用下面的代码即可
ActiproSoftware.Products.SyntaxEditor.AssemblyInfo.Instance.Resources.SetCustomString(“FindReplaceForm_Text”,”查找\替换”);
完整的字符串资源对应如下:
General_CancelButton_Text = Cancel
General_CloseButton_Text = Close
General_OkButton_Text = OK
CodeSnippet_InsertSnippetPopup_ShortcutLabel = Shortcut:
DocumentModificationType_AutoComplete = Auto-complete
DocumentModificationType_AutoFormat = Auto-format
DocumentModificationType_AutoIndent = Auto-indent
DocumentModificationType_AutoReplace = Auto-replace
DocumentModificationType_Backspace = Backspace
DocumentModificationType_ChangeCase = Change case
DocumentModificationType_CommentLines = Comment lines
DocumentModificationType_ConvertSpacesToTabs = Convert spaces to tabs
DocumentModificationType_ConvertTabsToSpaces = Convert tabs to spaces
DocumentModificationType_Custom = Custom
DocumentModificationType_Cut = Cut
DocumentModificationType_Delete = Delete
DocumentModificationType_DragAndDrop = Drag/drop
DocumentModificationType_DuplicateLine = Duplicate line
DocumentModificationType_Enter = Enter
DocumentModificationType_Indent = Indent
DocumentModificationType_InsertFile = Insert file
DocumentModificationType_InsertCodeSnippetTemplate = Insert snippet template
DocumentModificationType_OpenLine = Open line
DocumentModificationType_Outdent = Outdent
DocumentModificationType_Paste = Paste
DocumentModificationType_Replace = Replace
DocumentModificationType_ReplaceAll = Replace all
DocumentModificationType_SpellingChange = Spelling change
DocumentModificationType_ToggleCase = Toggle case
DocumentModificationType_TransposeCharacters = Transpose characters
DocumentModificationType_TransposeLines = Transpose lines
DocumentModificationType_TransposeWords = Transpose words
DocumentModificationType_TrimTrailingWhitespace = Trim trailing whitespace
DocumentModificationType_Typing = Typing
DocumentModificationType_UncommentLines = Uncomment lines
DocumentModificationType_Unknown = Unknown
DocumentModificationType_UpdateCodeSnippetTemplateFields = Update template fields
FindReplaceForm_Text = Find/Replace
FindReplaceForm_FindButton_Text = &Find Next
FindReplaceForm_FindWhatLabel_Text = Fi&nd what:
FindReplaceForm_MarkAllButton_Text = &Mark All
FindReplaceForm_MarkWithCheckBox_Text = Mark with bookmarks
FindReplaceForm_MatchCaseCheckBox_Text = Match &case
FindReplaceForm_MatchWholeWordCheckBox_Text = Match &whole word
FindReplaceForm_ReplaceButton_Text = &Replace
FindReplaceForm_ReplaceAllButton_Text = Replace &All
FindReplaceForm_ReplaceWithLabel_Text = Re&place with:
FindReplaceForm_SearchHiddenTextCheckBox_Text = Search &hidden text
FindReplaceForm_SearchInSelectionCheckBox_Text = Search in selection
FindReplaceForm_SearchTypeCheckBox_Text = Us&e
FindReplaceForm_SearchTypeDropDownList_Item_RegularExpressions = Regular expressions
FindReplaceForm_SearchTypeDropDownList_Item_Wildcards = Wildcards
FindReplaceForm_SearchUpCheckBox_Text = Search &up
FindReplaceForm_Error_Message = An error occurred:
FindReplaceForm_NotFound_Message = The specified text was not found.
FindReplaceForm_OccurrencesReplaced_Message = occurrence(s) replaced.
FindReplaceForm_PastSearchStartOffset_Message = Find reached the starting point of the search.
FindReplaceForm_RegularExpression_SingleCharacter = . Any single character
FindReplaceForm_RegularExpression_ZeroOrMore = * Zero or more
FindReplaceForm_RegularExpression_OneOrMore = + One or more
FindReplaceForm_RegularExpression_BeginningOfLine = ^ Beginning of line
FindReplaceForm_RegularExpression_EndOfLine = $ End of line
FindReplaceForm_RegularExpression_Group = ( ) Group / capture
FindReplaceForm_RegularExpression_WordBoundary = \\b Word boundary
FindReplaceForm_RegularExpression_Whitespace = \\s Whitespace
FindReplaceForm_RegularExpression_LineBreak = \\n Line break
FindReplaceForm_RegularExpression_OneCharacterInSet = [ ] Any one character in the set
FindReplaceForm_RegularExpression_OneCharacterNotInSet = [^ ] Any one character not in the set
FindReplaceForm_RegularExpression_Or = | Or
FindReplaceForm_RegularExpression_CharacterEscape = \\ Escape special character
FindReplaceForm_Wildcard_ZeroOrMore = * Zero or more of any character
FindReplaceForm_Wildcard_AnySingleCharacter = ? Any single character
FindReplaceForm_Wildcard_AnySingleDigit = # Any single digit
FindReplaceForm_Wildcard_OneCharacterInSet = [ ] Any one character in the set
FindReplaceForm_Wildcard_OneCharacterNotInSet = [! ] Any one character not in the set
GoToLineForm_Text = Go To Line
GoToLineForm_LineNumberLabel_Text = Line number (1 - {0}):
GoToLineForm_InvalidLineNumber_Message = Please enter a valid line number within the range.
GoToLineForm_InvalidNumber_Message = Please enter a valid number.
TextStatisticsForm_Text = Statistics
TextStatisticsForm_NameColumn_Text = Name
TextStatisticsForm_ValueColumn_Text = Value
TextStatisticsForm_Statistic_AverageLettersPerWord = Average Letters / Word
TextStatisticsForm_Statistic_AverageSyllablesPerWord = Average Syllables / Word
TextStatisticsForm_Statistic_AverageWordsPerSentence = Average Words / Sentence
TextStatisticsForm_Statistic_Characters = Characters
TextStatisticsForm_Statistic_CommentLineCoveragePercentage = Comment Line Coverage
TextStatisticsForm_Statistic_CommentLines = Lines (with comments)
TextStatisticsForm_Statistic_Consonants = Consonants
TextStatisticsForm_Statistic_FleschKincaidGradeLevel = Flesch-Kincaid Grade Level
TextStatisticsForm_Statistic_FleschReadingEaseScore = Flesch Reading Ease Score (0-100)
TextStatisticsForm_Statistic_Letters = Letters
TextStatisticsForm_Statistic_Lines = Lines
TextStatisticsForm_Statistic_NonWhitespaceCharacters = Characters (no spaces)
TextStatisticsForm_Statistic_NonWhitespaceLines = Lines (non-whitespace)
TextStatisticsForm_Statistic_PureCommentLines = Lines (only comments)
TextStatisticsForm_Statistic_Sentences = Sentences
TextStatisticsForm_Statistic_Syllables = Syllables
TextStatisticsForm_Statistic_Vowels = Vowels
TextStatisticsForm_Statistic_Words = Words
在我的项目中我使用了下面的代码实现本地化:
TreeViewGetCheckedNode
希望对您有所帮助。