.resx 和 .designer 文件是否需要按相同的顺序排列?

Do .resx and .designer files need to be in the same order?

我正在将我的代码与新版本合并(第一次),并且正在使用 winmerge 复制更改。我的问题是 .resx 和 .designer 文件是否必须排列,或者它们可以按任何顺序排列。因此,.resx 中的第 1 行和 .designer 中的第 1 行必须是相同的资源,或者如果第 1 行是 .designer 中的第 200 行,它会起作用吗?谢谢。

没关系。 resx 文件中的元素按名称寻址,而不是按索引寻址。因此 resx 可能有一个条目,例如 <data name="$this.Icon">...</data>,而 .designer.cs 包含对这个条目的引用,格式为 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 定义的顺序根本不重要。