Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Change access modifier?

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
Dierk Droth



Joined: 16 Nov 2010
Posts: 27

PostPosted: Tue Dec 07, 2010 5:19 pm    Post subject: Change access modifier? Reply with quote

Hi,

How could the access modifier of the generated .resx be changed, e.g. from "no code generation" to "Public".

If that is not possible: is there a way to have Globalizer generate the resources into a file which I manually created with access modifier "Public"?

Thanks
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Dec 07, 2010 11:24 pm    Post subject: Reply with quote

I'm not sure what you mean by the access modifier? Do you mean that you want to generate a code wrapper to allow type safe access code programmatic access to the resources?

I'm not sure why you would need to do this - but if that is want you want then you can modify the properties of the resources files after Globalizer.NET creates them. If you set the Custom Tool property to "ResXFileCodeGenerator" then Visual Studio will automatically generate a wrapper class for the resx file - however the name it choose for this by default will clash with the name of the Window/Form class. So you also need to set the Custom Tool Namespace property to avoid this. For instance set it to "WpfApp.Resources". Then you can access the resources programmatically through the generated WppApp.Resources.MyWindow class.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Dierk Droth



Joined: 16 Nov 2010
Posts: 27

PostPosted: Wed Dec 08, 2010 7:19 am    Post subject: Reply with quote

Here is my thought process:
- Globalizer generates a .resx file on extracting string resources from an XAML
- I'm using that .resx to manually add more resources which I needed in my code behind
- however, if I set the access modifier of that .resx file in my VS2010 from "No code generation" to "Public" (to work with the code wrappers for my manually generated ressources) I get this error
"Partial declarations of 'XAML file name' have conflicting accessibility modifiers"

Same happens when setting "ResXFileCodeGenerator" as you suggested

Any idea what's going wrong?

Thanks
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Dec 08, 2010 7:33 am    Post subject: Reply with quote

You'll get that error unless you set the Custom Tool Namespace as I described. That's because otherwise the type name of the generated class for accessing the resources will be the same as is generated for the WPF Window class.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Dierk Droth



Joined: 16 Nov 2010
Posts: 27

PostPosted: Wed Dec 08, 2010 1:17 pm    Post subject: Reply with quote

Excellent! That resolved the issue.

Thanks for your great support
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group