Storing custom properties in resx files in Compact Framework - compact-framework

We are developing a CF application and are making use of the default localization/resource handling in the framework (that is, when editing a form in the designer properties like Text have their value stored in the .resx files and the resource manager and framework loads it for us again in the selected locale using satelite assemblies and a call to ApplyResources in the .Designer file)
We have a few custom controls and one of these includes a string property called EditTitle. We would like this value to be stored in the resx file when editing the designer to get the same localization support as the Text property but we can't find anywhere to specify this. We do have an .xmta file for other designtime attributes but we can't find any element in there that would trigger this behavior.
Are there any way to specify this behavior for the particular property. Is it possible to do this for our own properties or is Visual Studio hardwired to only work with a known set of properties and we should be looking for other solutions (like editing the resx file by hand and hoping that the ApplyResources-call picks up and applies the EditTitle property)?

Well, discovered the solution (was pretty self-evident, actually). You can add the following attribute via the DesignTimeAttributes.xmta file:
<Property Name="EditTitle">
<Localizable>true</Localizable>
</Property>
This Localizable attribute will make sure that the value entered in the designer ends up in the .resx file

Related

Specifying the file detail properties of the output exe

I'm trying to figure out how to specify the file detail properties of the main executable file used in a Node Webkit app. More specifically, when the end user right-clicks the exe file and chooses 'Properties', then under the 'Details' tab, there are fields for Product Name, Product Version, Copyright, etc etc. These are blank by default. How do I specify the content for these fields?
I would have assumed that I could specify this in my app's manifest.json file, but the "name", "description", and "version" properties in the manifest file seem to have no effect here.
Any ideas? Or workarounds?
Your application is being run by the Node executable, but it looks like the executable is being built without that information being set.
Your best bet is to use a tool like ResourceHacker to edit the resources in the EXE directly.

How can I change the text in the Wix installer dialog?

My text message is stuck to "Install My Product to:"
How can I change this?
("My Product" is the name of my product and the string above is resolved based on the Name attribute in my Product.wxs).
I have 2 dialogs and the second requires a different message.
Some text on the built-in dialogs can be changed with variables specified in the localization file for your language. This is a simpler task than if you are trying to change text that is not kept in a variable.
This process is documented here.
However, if that's the case, the recommended way to change the dialog on the install page is to make a copy of and change the template file(s) provided with the WiX installation.
Copy the relevant .wxs files from your WiX dialog extension set (you will need to make sure you installed the WiX source) you want to modify and copy the file that specifies the UI extension name. Modify it to suit your needs and change the names.
When you compile your installer, you will use your new extension name (referring to your modified dialog set) and tell candle/light where your modified .wxs files are.
This process has some good documentation here and here.
Following the entire tutorial at the second link should get you pretty far.
Good luck

Disallow editing on linked (referenced) items

Recently I've found how to add a link to an item in Visual Studio so that you can reference common or shared files between projects. Editing the original propagates the changes to the projects where the file is referenced. But you can also edit the reference item and the changes are reflected in the original file, is there a way to prevent this behavior?
Reference item is the original file.
If you don't want “the original” to change, copy the file instead of referencing it.
Also, people like editing files.
If some code is not supposed to be edited, make it a binary.

Silverlight 4 MVVM app, resx editing by user, Blend only?

In a Silverlight 4 app, our user base needs to define for us what content they want on buttons, labels, various screen text, etc. I understand the methods of resource files, but what i'm wondering is when wanting to give that kind of control to the users to define the text in the resource file, what is the best way to let them do that in a way that they can view their changes to the XAML pages? Do they need to have Blend installed?
I vaguely remember when doing a WinForms app, at one point I handed off to the users the actual winform, and they used some sort of visual designer to edit button text, labels, etc., and those changes were then saved to the resource file.
Our app is MVVM, so each item in the XAML would bind to a property in its view model, and that property would then load the entry from the resource file.
If there is a way to let the user update the contents of the resx file while visually reviewing their changes please let me know.
Thanks very much in advance for any assistance.
What I have done in the past is to have a dedicated assembly for Resources (resx) files. By default, they are "embedded" into the assembly. The trick is to change the property on the resx file to NOT be embedded (False). This way, the files are separate resx xml files that must go with the assembly (and live in the same /bin directory of the running application). This is what you see in some /bin directories with the /en-US/ and other resources. In the past, I have created a simply GUI for users to be able to edit these resx files that gets written back to disk. I am not familiar with Silverlight's inner workings for this type of permissions needed, but I would guess at worse case the edited resx files just get uploaded to a server where a new copy is downloaded on next app restart or alike.
Now, when I said "in the past", that was back in 2003 days. Recently I had to do this manually using the ResXResourceReader because of an existing assembly I could not modify.
Some example code (writing it from memory, completely untested):
using (var reader = new ResXResourceReader("[path-to-bin]/MyResources.resx"))
{
var value = reader["My_key_in_the_resx_file"].ToString;
}
Do note that by going this route, you do have access to other types of resources such as binary and files embedded int he resx files.
Lastly, watch your encoding formats. Some over-seas editors use UTF16. So going with a common Unicode converter may be needed.
Also note there is a ResXResourceWriter class, should you want to roll your own writers for updating the resx files through code.

Interface Builder picking up wrong header file

I have two header files with EXACT same name in my project, it seems interface builder is picking the wrong one for "File Owner" dropdown, how can i change it to use the other header file?
Thanks.
Ideally, you should change the name of one of the header files!
Although you can certainly have same-named files in different folders within a project-- and in some cases, such as when you pull in third-party libraries, it'll just happen-- headers that you reference from Interface Builder should be a small subset that are under your control as your UI pieces. You should just rename one of the classes.
(There may be a way to get IB to differentiate, but even if there is, it seems like a fragile setup.)