开发者

RIA Services Localization, where to place Resource Files

I have the following Solution:

  1. SomeProject.Ria (non Silverlight code)
  2. SomeProject.Ria.Silverlight (Silverlight light code, namespace is still SomeProject.Ria)
  3. SomeProject.Ria.MyServices (RIA Services Domain Service)
  4. SomeProject.Ria.MyServices.Proxies (RIA Services Silverlight Generated Code)
  5. SomeProject.Shell (Silverlight Applicaiton)
  6. SomeProject.Web (Web Application)

I would like to use Resource Files for my Annotations on the meta data class in SomeProject.Ria.MyServices.

The format for that appears to be:

[Required(AllowEmptyStrings=false,ErrorMessageResourceName="ThisFieldIsRequired", ErrorMessageResourceType(MyResource))]     

Which project does MyResource belong in? (Assuming that someday I need to support other culture files).

Also the use of the string in here really seems to breed room for error, is it possible to do something like this and still achieve localization, or does this just get compiled into the meta data? If not, how can I get round the resource name being a string?

[Required(AllowEmptyStrings=false,ErrorMessage=MyResources.RequiredMessage)]           开发者_运维知识库 


I was directed to a very recent post from Brad Abrams that outlines what I needed to know:

http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜