It took the weekend two days to transplant the OPENCC into a WIN10-UWP usable library and complete its own conversion tool.
My simple tool download address: https://www.microsoft.com/store/apps/9nblggh68g62
Post-transplant code download address: Http://yunpan.cn/cFiYYCxwTLdfX access password 0533
Because today (2015-11-1-20:18), so if you are in today or the next Sando, is not found this software, because the micro-software store in the review.
A GIF to look at:
Taiwan's "Software " can be transformed into a continental " soft " Oh.
1. Porting1) Create a Vc++,dll Universal project
2) for (auto x:xs) to replace all for each (auto X in xs)
3) To close the security check, this is to make strcpy and other functions translated through.
4) All OPENCC CPP files, to disable the presets.
5) in the Config.cpp, to put #include <unordered_map> on the top, or not to edit. Unknown origin for the reason of the body.
After these steps, a DLL has been created successfully.
2. Create Runtinecomponent
I don't know if the C # project can directly adjust the DLL, without trying. Even if it can be adjusted, it is also a matter of trouble, and need to deal with a lot of types of conversion problems.
So, we need to create a generic project, all languages can be used to adjust the module, this module is runtinecomponent.
Can participate in the test blog: http://www.cnblogs.com/webabcd/p/3422563.html
And some of C++/cx's references, which you need to know: https://msdn.microsoft.com/en-us/library/windows/apps/hh699871.aspx
My example, named OPENCCX, adds an X to the back, which means that this is a mess, not the original author.
3. Using Runtinecomponent
Create a C # UWP project and add Openccxruntinecomponent Engineering to your solution.
In the UWP project, add a reference, select the project, and click "Make sure".
Then, you can use the Openccxruntinecomponent name space in your project.
The example is very simple:
New OPENCCXRUNTINECOMPONENT.OPENCCX ();---Create opencc_s2t. Load (OpenCCxRuntineComponent.ConverterType.Simple2Traditional); ---use what conversion rules
Private void Btn2simple_click (object sender, RoutedEventArgs e) { string ret = Opencc_t2s. Convert (TextBox.Text); ---use simple convert to OK. if NULL { = ret; } }
You can use a OPENCCX variable to load which.
In my code, the loaded stuff is saved and will not be re-downloaded.
You can also use more than one OPENCCX variable, and a change represents a conversion to see what a person needs.
[PS]
Finally, you can use your own simple conversion tool ^_^, thanks to OPENCC author.
OPENCC Address: Https://github.com/BYVoid/OpenCC
In line OPENCC address: opencc.byvoid.com
[END]
"WIN10" transplant OPENCC to WIN10-UWP, and make your own simple conversion tool