首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# 怎么实现对Attribute实现本地化语言

2012-08-01 
C# 如何实现对Attribute实现本地化语言C# code[CategoryAttribute(特性)]public virtual double 圆心X坐

C# 如何实现对Attribute实现本地化语言

C# code
        [CategoryAttribute("特性")]        public virtual double 圆心X坐标        {            get            {                return Owner.Center.x;            }            set            {                Owner.Center = new UnitPoint(value, Owner.Center.y);            }        }

我现在要将CategoryAttribute的"特性"翻译成不同语言版本的,不知道如何实现

[解决办法]
"特性"取自资源文件,你做好不同语言的资源文件
[CategoryAttribute(Properties.Resources.value)]
[解决办法]
自己继承CategoryAttribute,然后重写GetLocalizedString方法或者Category属性
[解决办法]
那还是重写 GetLocalizedString 吧,这里面试绝对可以用资源文件的
[解决办法]
探讨

引用:
自己继承CategoryAttribute,然后重写GetLocalizedString方法或者Category属性

这个要写的太多了

热点排行