Creating .resource file in windows forms - c#

I am trying to create a .resource file which will contain all the strings being used in the application. I don't want to do it manually.
I know there are certain ways to do it. But my problem is, I don't want to have it done manually, where I need to add each string resource. Is there a way to do this without I having to put each string, and it automatically detects all the strings resources corresponding to different pages.
Any insights on this would be helpful.

Yes, there is a way to do this.
You can try with R#, although the tool is commercial, there is a 30-days trial period.
As a regular user, I can tell you that it worth every cent.
There are suggestion for every string, and moving to the resource file is accomplished by one click.

Related

C# easiest way of storing strings to external file

C#
TL;DR: I want the user to be able to input text, which is then written to an external file, which then can be called later based on position in the file. What's the easiest way and form to read and write a list of strings to?
Very amateur question, but I can't seem to find an easy anwer on the internet. If I'm missing something obvious, please redirect me. I am writing a very simple program in which the user can input a string which is then written (added) to an external file, from which later a string can be called based on the position in the file. I found things like JSON, Resource file, SQL DB... Problem is that due to my lack of programming experience I have no idea what's the best option to look into.
Example of what I want to achieve:
User inputs strings 'Dog', 'Cat', and 'Horse' into the textbox. Each of these strings are added to the external file. Lateron, the user calls the 2nd number on the list, to which the program returns 'Cat'.
Thanks!
If you already know the kind of data that will be saved I recommend using XML Serialization. This lets you save and read your file very easily. The linked example is from Microsoft and shows a dataset being serialized. If you want to save a generic list instead of a fixed object you might find this link helpful.
Alternatively, you could save data to your application configuration file (search online for "C# application configuration for PROJECT_TYPE" where the project type is winforms/mvc/class library etc..)

Real time editor for Cloud Storage System

I am working on cloud storage system in ASP.Net MVC5. In which I made a file manager that handles cut,copy,download multiple files,edit and preview of files, but I want to edit documents like word files in real time (collaborative editing)..is there any api that can help me accordingly.
Thank you in advance.
you should use Signal R for real time applications...it may be possible with the help of application user interface but its better to write your own code according to your choice...
[http://signalr.net/][1]
dev_express and syncfusion may be your solution..try these..
This is turning into a huge comment, so I'll just explain my point of view in an answer. I'll remove it, if I see an actual answer appears.
I am suggesting you start writing your own code for collaborative editing and the reason is quite simple. You need at least slightly different processing for almost each file type, which suggests there will never be a single API to support collaborative editing for all file types, unless somebody makes it their goal to maintain it and keep up with every one created.
Start it simple, text (or hex) editing. Define how changes are made and implemented on other clients and then work your way to add as many file types (and methods that go with them) as you need.
You could use source code of 1 of these open source collaborative text editors (you'll have to find download / Github links on their websites) to get a general idea how to do it, but you will still have to put in some work and won't go far without creating your own code.
Collaborative editing requires user 1's (who just started editing) client to send either one of these:
Data pointing to changes made in file
Full file, and user 2's client (or central "server") should be able to calculate the changes made from there and implement them.
One of the problems is to overwrite only that portion of the file changes were made to (and avoid overwriting the other user 2's work).
And the biggest problem (the reason you can't have "1 for all" method/API) is each file type has its own structure meaning that different file types will have different data representing changes in file. If you try to write raw data it might work, but you'd still need to calculate and lock away specific portions of file, that contain general information, rather than data of your file.

Adding Custom File Properties/Attribute with Java or C# in Windows

Is it possible to add custom file attribute in file Properties preferably using Java, otherwise C#?
Custom fields I want to do is
Don't let the file copy. (But it can be modified)
Don't let the file attach to anything that that connects to network.
Here you can see below Where I want to add these attributes.
First question is can I actually do this? If yes then how? Any Idea will be really appreciated.
No, not really. File Custom Properties were added in Vista, but they are really just metadata related to files (of a given extension) plus some COM interfaces to show them to the user, etc. I.e., you can index properties, display them, edit them, etc. but properties won't be able to keep a file from being read (and thus copied).
If you are interested, your can review the MS docs for file properties http://msdn.microsoft.com/en-us/library/windows/desktop/ff728898(v=vs.85).aspx. This page detailning the predined properties is probably the easiest way to see how are used http://msdn.microsoft.com/en-us/library/windows/desktop/dd561977(v=vs.85).aspx

Add languages at runtime

I have a multi-language windows application that uses standard .net localization in resx files.
Now I have a request to add a possibility for user to create his own language files that are not originally supported and add them to the application without recompiling it.
What's the best approach to achieve this?
I'm considering moving the languages to database and then crating a second tool that'll add translations to the database, but would rather keep the current approach, if it's possible to add resx files dynamically.
This is exactly why I don’t use .NET localization but wrote my own.
I store the translations in files separate from the EXE, have a Windows-Forms-based GUI for translation that I can embed in any application (and working on a WPF clone of it), and allow users to switch languages without restarting the application.
I don’t get why anyone would want it any different and why Microsoft created such a bad and limited system.
Unfortunately, I cannot publish my system right now, but I’m hoping I’ll be able to soon.
One option you can use is keep the translations in an XML file. This way, the user can just drop his own XML file into the folder where the translation exists.
You could write the translations to .resx file and just add the location of that file to the database and then when you want to translate some label just go to the database to see where that file is and then read from it. I'm not sure though how it would fit with a localisation lib...

write the contents of application page to a file in WP7

I want to write the entire contents of my application page (eg Mainpage.xml) to a file (in Isolated Storage ) How do I do it in WP7 ? are there any methods available to parse the page contents and write it to file in windows phone 7 ?
There is no built in way to do this.
However there are a couple of approaches you could try:
If the structure is static you could try and extract the resource containing this from the DLL. For future re-use it would be easier to load the page from the DLL again though.
If you're generating a page (or part of a page) at runtime (based on user input/preferences) and you want to be able to save/reload this then just save enough information to be able to recreate it. It's unlikely that XAML would be the best format for this though.
You could create this as you build the UI. Alternatively you could walk the visual tree to get details of all that is rendered. I'd recommend recording as you go so you can more easily keep track of non-default values in the rendered objects.

Categories