资源文件VS静态类为将不需要值在C#进行本地化 [英] Resource File vs Static Class for values that will not need to be localized in C#

查看:153
本文介绍了资源文件VS静态类为将不需要值在C#进行本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无意中听到我的两个同事讨论这个话题,我想知道的总体思路是什么。

I overheard two of my coworkers debating this topic and I was wondering what the general thought is.

目前在我们的应用中使用了大量的键值对的和他们正在寻找实现一个解决办法,避免我们记住的键的拼写的最佳方式。

Right now in our application we use a lot of key value pairs and they are looking for the best way to implement a solution that would avoid us to remember the spelling for the key.

推荐答案

一个资源文件生成幕后静态类,所以你用同样的事情最终基本上访问这些资源。只是,如果你使用一个资源文件,有一天你决定本地化你是好去。当然,没有明确回答这个问题。既解决方案是完全可行的主观看向我。

A resource file generates static class behind the scenes to access those resources so you end up basically with the same thing. It's just that if you use a resource file and one day you decide to localize you are good to go. Of course there is no definite answer to this question. Looks subjective to me as both solutions are perfectly viable.

这篇关于资源文件VS静态类为将不需要值在C#进行本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆