重构源生成器:支持多生成模式(Dictionary/Compiled)、多通知模式、多依赖模式#33
Open
walterlv wants to merge 53 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增
GenerationMode— 两种生成模式:Dictionary:运行时字典查找,支持动态 Key,WPF 绑定兼容(多类树,每个节点独立实现接口和INotifyPropertyChanged)Compiled:编译时字面量,单类 + 显式接口实现,零分配,不可索引NotificationMode— 三种通知模式:InitOnly:无变更通知CurrentCulturePropertyChanged:切换语言时通知LocalizationItemPropertyChanged:逐项通知DependencyMode— 两种依赖模式:Library:引用库NestedSource:自包含,将LocalizedString、ILocalizedStringProvider等基础类型生成为内部类,零外部依赖LocalizedString<T1..T8>泛型格式化字符串,支持最多 8 个参数(之前最多只支持 4 个)设计变化
LocalizationGeneratorSourceTextBuilder全面替换旧的字符串模板,删除 6 个模板文件和TemplateRegexes