[
  {
    "path": ".gitattributes",
    "content": "###############################################################################\n# Set default behavior to automatically normalize line endings.\n###############################################################################\n* text=auto\n\n###############################################################################\n# Set default behavior for command prompt diff.\n#\n# This is need for earlier builds of msysgit that does not have it on by\n# default for csharp files.\n# Note: This is only used by command line\n###############################################################################\n#*.cs     diff=csharp\n\n###############################################################################\n# Set the merge driver for project and solution files\n#\n# Merging from the command prompt will add diff markers to the files if there\n# are conflicts (Merging from VS is not affected by the settings below, in VS\n# the diff markers are never inserted). Diff markers may cause the following \n# file extensions to fail to load in VS. An alternative would be to treat\n# these files as binary and thus will always conflict and require user\n# intervention with every merge. To do so, just uncomment the entries below\n###############################################################################\n#*.sln       merge=binary\n#*.csproj    merge=binary\n#*.vbproj    merge=binary\n#*.vcxproj   merge=binary\n#*.vcproj    merge=binary\n#*.dbproj    merge=binary\n#*.fsproj    merge=binary\n#*.lsproj    merge=binary\n#*.wixproj   merge=binary\n#*.modelproj merge=binary\n#*.sqlproj   merge=binary\n#*.wwaproj   merge=binary\n\n###############################################################################\n# behavior for image files\n#\n# image files are treated as binary by default.\n###############################################################################\n#*.jpg   binary\n#*.png   binary\n#*.gif   binary\n\n###############################################################################\n# diff behavior for common document formats\n# \n# Convert binary document formats to text before diffing them. This feature\n# is only available from the command line. Turn it on by uncommenting the \n# entries below.\n###############################################################################\n#*.doc   diff=astextplain\n#*.DOC   diff=astextplain\n#*.docx  diff=astextplain\n#*.DOCX  diff=astextplain\n#*.dot   diff=astextplain\n#*.DOT   diff=astextplain\n#*.pdf   diff=astextplain\n#*.PDF   diff=astextplain\n#*.rtf   diff=astextplain\n#*.RTF   diff=astextplain\n"
  },
  {
    "path": ".gitignore",
    "content": "Thumbs.db\n*.obj\n*.pdb\n*.user\n*.aps\n*.pch\n*.vspscc\n*_i.c\n*_p.c\n*.ncb\n*.suo\n*.sln.docstates\n*.tlb\n*.tlh\n*.bak\n*.cache\n*.ilk\n*.log\n[Bb]in\n[Dd]ebug*/\n*.lib\n*.sbr\nobj/\n[Rr]elease*/\n_ReSharper*/\n[Tt]est[Rr]esult*\n*.vssscc\n$tf*/\n.vs/\n"
  },
  {
    "path": "COPYING",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "COPYING.LESSER",
    "content": "                   GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n  This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n  0. Additional Definitions.\n\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n  \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n  An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n  A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library.  The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n  The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n  The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n  1. Exception to Section 3 of the GNU GPL.\n\n  You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n  2. Conveying Modified Versions.\n\n  If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n   a) under this License, provided that you make a good faith effort to\n   ensure that, in the event an Application does not supply the\n   function or data, the facility still operates, and performs\n   whatever part of its purpose remains meaningful, or\n\n   b) under the GNU GPL, with none of the additional permissions of\n   this License applicable to that copy.\n\n  3. Object Code Incorporating Material from Library Header Files.\n\n  The object code form of an Application may incorporate material from\na header file that is part of the Library.  You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n   a) Give prominent notice with each copy of the object code that the\n   Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the object code with a copy of the GNU GPL and this license\n   document.\n\n  4. Combined Works.\n\n  You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n   a) Give prominent notice with each copy of the Combined Work that\n   the Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\n   document.\n\n   c) For a Combined Work that displays copyright notices during\n   execution, include the copyright notice for the Library among\n   these notices, as well as a reference directing the user to the\n   copies of the GNU GPL and this license document.\n\n   d) Do one of the following:\n\n       0) Convey the Minimal Corresponding Source under the terms of this\n       License, and the Corresponding Application Code in a form\n       suitable for, and under terms that permit, the user to\n       recombine or relink the Application with a modified version of\n       the Linked Version to produce a modified Combined Work, in the\n       manner specified by section 6 of the GNU GPL for conveying\n       Corresponding Source.\n\n       1) Use a suitable shared library mechanism for linking with the\n       Library.  A suitable mechanism is one that (a) uses at run time\n       a copy of the Library already present on the user's computer\n       system, and (b) will operate properly with a modified version\n       of the Library that is interface-compatible with the Linked\n       Version.\n\n   e) Provide Installation Information, but only if you would otherwise\n   be required to provide such information under section 6 of the\n   GNU GPL, and only to the extent that such information is\n   necessary to install and execute a modified version of the\n   Combined Work produced by recombining or relinking the\n   Application with a modified version of the Linked Version. (If\n   you use option 4d0, the Installation Information must accompany\n   the Minimal Corresponding Source and Corresponding Application\n   Code. If you use option 4d1, you must provide the Installation\n   Information in the manner specified by section 6 of the GNU GPL\n   for conveying Corresponding Source.)\n\n  5. Combined Libraries.\n\n  You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n   a) Accompany the combined library with a copy of the same work based\n   on the Library, uncombined with any other library facilities,\n   conveyed under the terms of this License.\n\n   b) Give prominent notice with the combined library that part of it\n   is a work based on the Library, and explaining where to find the\n   accompanying uncombined form of the same work.\n\n  6. Revised Versions of the GNU Lesser General Public License.\n\n  The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n  Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n  If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n"
  },
  {
    "path": "LECommonLibrary/AssociationReader.cs",
    "content": "﻿using System;\nusing Microsoft.Win32;\n\nnamespace LECommonLibrary\n{\n    public class AssociationReader\n    {\n        public static bool HaveAssociatedProgram(string ext)\n        {\n            if (GetAssociatedProgram(ext) == null)\n                return false;\n\n            return true;\n        }\n\n        public static string[] GetAssociatedProgram(string ext)\n        {\n            var prog = GetAssociatedProgramFromRegistry(ext);\n\n            if (prog == null)\n                return null;\n\n            var jb = SplitExecutableAndArgument(prog);\n\n            return jb;\n        }\n\n        public static string GetAssociatedIcon(string ext)\n        {\n            var prog = GetAssociatedIconFromRegistry(ext);\n\n            if (prog == null)\n                return null;\n\n            return prog;\n        }\n\n        private static string GetAssociatedIconFromRegistry(string ext)\n        {\n            var d = (string)Registry.GetValue($\"HKEY_CLASSES_ROOT\\\\{ext}\", null, null);\n\n            if (string.IsNullOrEmpty(d))\n                return null;\n\n            var prog =\n                (string)Registry.GetValue($\"HKEY_CLASSES_ROOT\\\\{d}\\\\DefaultIcon\", null, null);\n\n            return prog;\n        }\n\n        private static string[] SplitExecutableAndArgument(string line)\n        {\n            var ret = line.StartsWith(\"\\\"\")\n                          ? line.Split(new[] {\"\\\" \"}, 2, StringSplitOptions.None)\n                          : line.Split(new[] {' '}, 2, StringSplitOptions.None);\n\n            if (ret.Length == 2)\n            {\n                ret[0] = ret[0].StartsWith(\"\\\"\") ? ret[0].Substring(1) : ret[0];\n                return ret;\n            }\n            return null;\n        }\n\n        private static string GetAssociatedProgramFromRegistry(string ext)\n        {\n            var d = (string)Registry.GetValue($\"HKEY_CLASSES_ROOT\\\\{ext}\", null, null);\n\n            if (string.IsNullOrEmpty(d))\n                return null;\n\n            var prog =\n                (string)Registry.GetValue($\"HKEY_CLASSES_ROOT\\\\{d}\\\\Shell\\\\Open\\\\Command\", null, null);\n\n            return prog;\n        }\n    }\n}"
  },
  {
    "path": "LECommonLibrary/GlobalHelper.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Windows.Forms;\nusing System.Xml.Linq;\n\nnamespace LECommonLibrary\n{\n    public static class GlobalHelper\n    {\n        public static string GlobalVersionPath =\n            Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                         \"LEVersion.xml\");\n\n        public static string GetLEVersion()\n        {\n            try\n            {\n                var doc = XDocument.Load(GlobalVersionPath);\n\n                return doc.Descendants(\"LEVersion\").First().Attribute(\"Version\").Value;\n            }\n            catch\n            {\n                return \"0.0.0.0\";\n            }\n        }\n\n        public static int GetLastUpdate()\n        {\n            try\n            {\n                var doc = XDocument.Load(GlobalVersionPath);\n\n                return int.Parse(doc.Descendants(\"LEVersion\").First().Attribute(\"LastUpdate\").Value);\n            }\n            catch\n            {\n                return 0;\n            }\n        }\n\n        public static void SetLastUpdate(int date)\n        {\n            try\n            {\n                var doc = XDocument.Load(GlobalVersionPath);\n\n                doc.Descendants(\"LEVersion\").First().Attribute(\"LastUpdate\").Value = date.ToString().PadLeft(8, '0');\n\n                doc.Save(GlobalVersionPath);\n            }\n            catch\n            {\n            }\n        }\n\n        public static void ShowErrorDebugMessageBox(string commandLine, uint errorCode)\n        {\n            MessageBox.Show(\n                            $\"Error Number: {Convert.ToString(errorCode, 16).ToUpper()}\\r\\n\"\n                            + $\"Commands: {commandLine}\\r\\n\" + \"\\r\\n\"\n                            + $\"{string.Format($\"{Environment.OSVersion} {(SystemHelper.Is64BitOS() ? \"x64\" : \"x86\")}\", Environment.OSVersion, SystemHelper.Is64BitOS() ? \"x64\" : \"x86\")}\\r\\n\"\n                            + $\"{GenerateSystemDllVersionList()}\\r\\n\"\n                            + \"If you have any antivirus software running, please turn it off and try again.\\r\\n\"\n                            + \"If this window still shows, try go to Safe Mode and drag the application \"\n                            + \"executable onto LEProc.exe.\\r\\n\"\n                            + \"If you have tried all above but none of them works, feel free to submit an issue at\\r\\n\"\n                            + \"https://github.com/xupefei/Locale-Emulator/issues.\\r\\n\" + \"\\r\\n\" + \"\\r\\n\"\n                            + \"You can press CTRL+C to copy this message to your clipboard.\\r\\n\",\n                            \"Locale Emulator Version \" + GetLEVersion());\n        }\n\n        private static string GenerateSystemDllVersionList()\n        {\n            string[] dlls = {\"NTDLL.DLL\", \"KERNELBASE.DLL\", \"KERNEL32.DLL\", \"USER32.DLL\", \"GDI32.DLL\"};\n\n            var result = new StringBuilder();\n\n            foreach (var dll in dlls)\n            {\n                var version = FileVersionInfo.GetVersionInfo(\n                                                             Path.Combine(\n                                                                          Path.GetPathRoot(Environment.SystemDirectory),\n                                                                          SystemHelper.Is64BitOS()\n                                                                              ? @\"Windows\\SysWOW64\\\"\n                                                                              : @\"Windows\\System32\\\",\n                                                                          dll));\n\n                result.Append(dll);\n                result.Append(\": \");\n                result.Append(\n                              $\"{version.FileMajorPart}.{version.FileMinorPart}.{version.FileBuildPart}.{version.FilePrivatePart}\");\n                result.Append(\"\\r\\n\");\n            }\n\n            return result.ToString();\n        }\n\n        public static bool CheckCoreDLLs()\n        {\n            string[] dlls = {\"LoaderDll.dll\", \"LocaleEmulator.dll\"};\n\n            return\n                dlls.Select(dll => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), dll))\n                    .All(File.Exists);\n        }\n    }\n}"
  },
  {
    "path": "LECommonLibrary/LECommonLibrary.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{C4DEF32B-8FBB-41B6-80DC-C60339402323}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>LECommonLibrary</RootNamespace>\n    <AssemblyName>LECommonLibrary</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AssociationReader.cs\" />\n    <Compile Include=\"GlobalHelper.cs\" />\n    <Compile Include=\"LEConfig.cs\" />\n    <Compile Include=\"LEProfile.cs\" />\n    <Compile Include=\"PEFileReader.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"SystemHelper.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"key.snk\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <PropertyGroup>\n    <PostBuildEvent>copy /Y \"$(TargetPath)\" \"$(SolutionDir)LEInstaller\\Resources\\\"\n</PostBuildEvent>\n  </PropertyGroup>\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "LECommonLibrary/LEConfig.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Xml.Linq;\n\nnamespace LECommonLibrary\n{\n    public static class LEConfig\n    {\n        public static string GlobalConfigPath =\n            Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                         \"LEConfig.xml\");\n\n        public static LEProfile GetProfile(string name)\n        {\n            try\n            {\n                return GetProfiles(GlobalConfigPath).Where(p => p.Name == name).ToArray()[0];\n            }\n            catch\n            {\n                return new LEProfile();\n            }\n        }\n\n        public static LEProfile[] GetProfiles()\n        {\n            return GetProfiles(GlobalConfigPath);\n        }\n\n        public static LEProfile[] GetProfiles(string configPath)\n        {\n            try\n            {\n                var dict = XDocument.Load(configPath);\n\n                var pros = from i in dict.Descendants(\"LEConfig\").Elements(\"Profiles\").Elements()\n                           select i;\n\n                var profiles =\n                    pros.Select(p => new LEProfile(p.Attribute(\"Name\").Value,\n                                                   p.Attribute(\"Guid\").Value,\n                                                   bool.Parse(p.Attribute(\"MainMenu\").Value),\n                                                   p.Element(\"Parameter\").Value,\n                                                   p.Element(\"Location\").Value,\n                                                   p.Element(\"Timezone\").Value,\n                                                   bool.Parse(p.TryGetValue(\"RunAsAdmin\", \"false\")),\n                                                   bool.Parse(p.TryGetValue(\"RedirectRegistry\", \"true\")),\n                                                   bool.Parse(p.TryGetValue(\"IsAdvancedRedirection\", \"false\")),\n                                                   bool.Parse(p.TryGetValue(\"RunWithSuspend\", \"false\"))\n                                         )\n                        ).ToArray();\n\n                return profiles;\n            }\n            catch\n            {\n                return new LEProfile[0];\n            }\n        }\n\n        public static bool CheckGlobalConfigFile(bool buildNewConfig)\n        {\n            if (buildNewConfig && !File.Exists(GlobalConfigPath))\n                BuildGlobalConfigFile();\n\n            return File.Exists(GlobalConfigPath);\n        }\n\n        public static void SaveGlobalConfigFile(params LEProfile[] profiles)\n        {\n            WriteConfig(GlobalConfigPath, profiles);\n        }\n\n        public static void SaveApplicationConfigFile(string path, LEProfile profile)\n        {\n            WriteConfig(path, profile);\n        }\n\n        private static void BuildGlobalConfigFile()\n        {\n            var defaultProfiles = new[]\n                                  {\n                                      new LEProfile(\"Run in Japanese\",\n                                                    Guid.NewGuid().ToString(),\n                                                    false,\n                                                    string.Empty,\n                                                    \"ja-JP\",\n                                                    \"Tokyo Standard Time\",\n                                                    false,\n                                                    true,\n                                                    false,\n                                                    false\n                                          ),\n                                      new LEProfile(\"Run in Japanese (Admin)\",\n                                                    Guid.NewGuid().ToString(),\n                                                    false,\n                                                    string.Empty,\n                                                    \"ja-JP\",\n                                                    \"Tokyo Standard Time\",\n                                                    true,\n                                                    true,\n                                                    false,\n                                                    false\n                                          )\n                                  };\n\n            WriteConfig(GlobalConfigPath, defaultProfiles);\n        }\n\n        private static string TryGetValue(this XElement element, string name, string defaultValue = null)\n        {\n            var found = element.Element(name);\n            if (found != null)\n            {\n                return found.Value;\n            }\n            return defaultValue;\n        }\n\n        private static void WriteConfig(string writeTo, params LEProfile[] profiles)\n        {\n            var baseNode = new XElement(\"Profiles\");\n\n            foreach (var pro in profiles)\n            {\n                baseNode.Add(new XElement(\"Profile\",\n                                          new XAttribute(\"Name\", pro.Name),\n                                          new XAttribute(\"Guid\", pro.Guid),\n                                          new XAttribute(\"MainMenu\", pro.ShowInMainMenu),\n                                          new XElement(\"Parameter\", pro.Parameter),\n                                          new XElement(\"Location\", pro.Location),\n                                          new XElement(\"Timezone\", pro.Timezone),\n                                          new XElement(\"RunAsAdmin\", pro.RunAsAdmin),\n                                          new XElement(\"RedirectRegistry\", pro.RedirectRegistry),\n                                          new XElement(\"IsAdvancedRedirection\", pro.IsAdvancedRedirection),\n                                          new XElement(\"RunWithSuspend\", pro.RunWithSuspend)\n                                 )\n                    );\n            }\n\n            var tree = new XElement(\"LEConfig\", baseNode);\n\n            try\n            {\n                tree.Save(writeTo);\n            }\n            catch\n            {\n            }\n        }\n    }\n}"
  },
  {
    "path": "LECommonLibrary/LEProfile.cs",
    "content": "﻿namespace LECommonLibrary\n{\n    public struct LEProfile\n    {\n        public string Guid;\n        public bool IsAdvancedRedirection;\n        public string Location;\n        public string Name;\n        public string Parameter;\n        public bool RedirectRegistry;\n        public bool RunAsAdmin;\n        public bool RunWithSuspend;\n        public bool ShowInMainMenu;\n        public string Timezone;\n\n        /// <summary>\n        ///     Create a new LEProfile object using default(ja-JP) settings.\n        /// </summary>\n        /// <param name=\"isDefault\">A placeholder, not used at all.</param>\n        public LEProfile(bool isDefault)\n            : this(\n                \"ja-JP\",\n                System.Guid.NewGuid().ToString(),\n                false,\n                string.Empty,\n                \"ja-JP\",\n                \"Tokyo Standard Time\",\n                false,\n                true,\n                false,\n                false)\n        {\n        }\n\n        /// <summary>\n        ///     Create a new LEProfile using arguments.\n        /// </summary>\n        public LEProfile(string name,\n                         string guid,\n                         bool showInMainMenu,\n                         string parameter,\n                         string location,\n                         string timezone,\n                         bool runAsAdmin,\n                         bool redirectRegistry,\n                         bool isAdvancedRedirection,\n                         bool runWithSuspend)\n        {\n            Name = name;\n            Guid = guid;\n            ShowInMainMenu = showInMainMenu;\n            Parameter = parameter;\n            Location = location;\n            Timezone = timezone;\n            RunAsAdmin = runAsAdmin;\n            RedirectRegistry = redirectRegistry;\n            IsAdvancedRedirection = isAdvancedRedirection;\n            RunWithSuspend = runWithSuspend;\n        }\n    }\n}"
  },
  {
    "path": "LECommonLibrary/PEFileReader.cs",
    "content": "﻿using System.IO;\n\nnamespace LECommonLibrary\n{\n    public enum PEType\n    {\n        X32,\n        X64,\n        Unknown\n    }\n\n    public static class PEFileReader\n    {\n        public static PEType GetPEType(string path)\n        {\n            if (string.IsNullOrEmpty(path))\n                return PEType.Unknown;\n\n            try\n            {\n                using (var br = new BinaryReader(new FileStream(path,\n                                                    FileMode.Open,\n                                                    FileAccess.Read,\n                                                    FileShare.ReadWrite)))\n                {\n                    if (br.BaseStream.Length < 0x3C + 4 || br.ReadUInt16() != 0x5A4D)\n                        return PEType.Unknown;\n\n                    br.BaseStream.Seek(0x3C, SeekOrigin.Begin);\n                    var pos = br.ReadUInt32() + 4;\n\n                    if (pos + 2 > br.BaseStream.Length)\n                        return PEType.Unknown;\n\n                    br.BaseStream.Seek(pos, SeekOrigin.Begin);\n                    var machine = br.ReadUInt16();\n\n                    if (machine == 0x014C)\n                        return PEType.X32;\n                    else if (machine == 0x8664)\n                        return PEType.X64;\n\n                    return PEType.Unknown;\n                }\n            }\n            catch\n            {\n                return PEType.Unknown;\n            }\n        }\n    }\n}"
  },
  {
    "path": "LECommonLibrary/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"LECommonLibrary\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Paddy Xu\")]\n[assembly: AssemblyProduct(\"LECommonLibrary\")]\n[assembly: AssemblyCopyright(\"Copyright © Paddy Xu 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"cecde841-88b7-4b2e-bd0d-fc94d345f507\")]"
  },
  {
    "path": "LECommonLibrary/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LECommonLibrary.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"LECommonLibrary.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LECommonLibrary/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n</root>"
  },
  {
    "path": "LECommonLibrary/SystemHelper.cs",
    "content": "﻿using System;\nusing System.Drawing;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Security.Principal;\n\nnamespace LECommonLibrary\n{\n    public static class SystemHelper\n    {\n        public static bool Is64BitOS()\n        {\n            //The code below is from http://1code.codeplex.com/SourceControl/changeset/view/39074#842775\n            //which is under the Microsoft Public License: http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.\n\n            if (IntPtr.Size == 8) // 64-bit programs run only on Win64\n            {\n                return true;\n            }\n            // Detect whether the current process is a 32-bit process \n            // running on a 64-bit system.\n            bool flag;\n            return DoesWin32MethodExist(\"kernel32.dll\", \"IsWow64Process\") &&\n                   IsWow64Process(GetCurrentProcess(), out flag) && flag;\n        }\n\n        private static bool DoesWin32MethodExist(string moduleName, string methodName)\n        {\n            var moduleHandle = GetModuleHandle(moduleName);\n            if (moduleHandle == IntPtr.Zero)\n            {\n                return false;\n            }\n            return GetProcAddress(moduleHandle, methodName) != IntPtr.Zero;\n        }\n\n        public static string RedirectToWow64(string path)\n        {\n            var system = Environment.ExpandEnvironmentVariables(\"%SystemRoot%\\\\System32\\\\\").ToLower();\n            var systemWow64 = Environment.ExpandEnvironmentVariables(\"%SystemRoot%\\\\SysWOW64\\\\\").ToLower();\n\n            path = Environment.ExpandEnvironmentVariables(path).ToLower();\n\n            return path.Replace(system, systemWow64);\n        }\n\n        public static string EnsureAbsolutePath(string path)\n        {\n            return Path.IsPathRooted(path) ? path : Path.GetFullPath(path);\n        }\n\n        public static bool Is4KDisplay()\n        {\n            Graphics g = Graphics.FromHwnd(IntPtr.Zero);\n            IntPtr desktop = g.GetHdc();\n\n            // 10 = VERTRES\n            // 90 = LOGPIXELSY\n            // 117 = DESKTOPVERTRES\n            int logicDpi = GetDeviceCaps(desktop, 10);\n            int logY = GetDeviceCaps(desktop, 90);\n            int realDpi = GetDeviceCaps(desktop, 117);\n\n            g.ReleaseHdc();\n\n            return (realDpi/logicDpi == 2) || (logY/96 == 2);\n        }\n\n        public static void DisableDPIScale()\n        {\n            SetProcessDPIAware();\n        }\n\n        [DllImport(\"gdi32.dll\")]\n        public static extern int GetDeviceCaps(IntPtr hDC, int nIndex);\n\n        [DllImport(\"user32.dll\")]\n        private static extern bool SetProcessDPIAware();\n\n        [DllImport(\"kernel32.dll\")]\n        private static extern IntPtr GetCurrentProcess();\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto)]\n        private static extern IntPtr GetModuleHandle(string moduleName);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        private static extern IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string procName);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        [return: MarshalAs(UnmanagedType.Bool)]\n        private static extern bool IsWow64Process(IntPtr hProcess, out bool wow64Process);\n\n        public static bool CheckPermission(string path)\n        {\n            try\n            {\n                var tempGuid = Guid.NewGuid().ToString();\n\n                File.Create(Path.Combine(path, tempGuid)).Close();\n                File.Delete(Path.Combine(path, tempGuid));\n\n                return true;\n            }\n            catch\n            {\n                return false;\n            }\n        }\n\n        public static bool IsAdministrator()\n        {\n            var wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());\n\n            return wp.IsInRole(WindowsBuiltInRole.Administrator);\n        }\n\n        /// <summary>\n        ///     RunWithElevatedProcess\n        /// </summary>\n        /// <exception cref=\"Exception\">Run error.</exception>\n        /// <param name=\"executable\"></param>\n        /// <param name=\"args\"></param>\n        public static void RunWithElevatedProcess(string executable, string[] args)\n        {\n            var arg = string.Empty;\n            arg = args == null\n                      ? string.Empty\n                      : args.Aggregate(arg, (current, s) => current + $\" \\\"{s}\\\"\");\n\n            var shExecInfo = new SHELLEXECUTEINFO();\n\n            shExecInfo.cbSize = Marshal.SizeOf(shExecInfo);\n\n            shExecInfo.fMask = 0;\n            shExecInfo.hwnd = IntPtr.Zero;\n            shExecInfo.lpVerb = \"runas\";\n            shExecInfo.lpFile = executable;\n            shExecInfo.lpParameters = arg;\n            shExecInfo.lpDirectory = Path.GetDirectoryName(executable);\n\n            ;\n\n            if (ShellExecuteEx(ref shExecInfo) == false)\n            {\n                throw new Exception(\"Error when run with elevated LE.\\r\\n\" + $\"Executable: {executable}\\r\\n\"\n                                    + $\"Arguments: {arg}\");\n            }\n        }\n\n        [DllImport(\"shell32.dll\", CharSet = CharSet.Auto)]\n        private static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);\n\n        [StructLayout(LayoutKind.Sequential)]\n        public struct SHELLEXECUTEINFO\n        {\n            public int cbSize;\n            public uint fMask;\n            public IntPtr hwnd;\n            [MarshalAs(UnmanagedType.LPTStr)] public string lpVerb;\n            [MarshalAs(UnmanagedType.LPTStr)] public string lpFile;\n            [MarshalAs(UnmanagedType.LPTStr)] public string lpParameters;\n            [MarshalAs(UnmanagedType.LPTStr)] public string lpDirectory;\n            public int nShow;\n            public IntPtr hInstApp;\n            public IntPtr lpIDList;\n            [MarshalAs(UnmanagedType.LPTStr)] public string lpClass;\n            public IntPtr hkeyClass;\n            public uint dwHotKey;\n            public IntPtr hIcon;\n            public IntPtr hProcess;\n        }\n    }\n}"
  },
  {
    "path": "LEContextMenuHandler/FileContextMenuExt.cs",
    "content": "﻿/********************************** Module Header **********************************\\\nModule Name:  FileContextMenuExt.cs\nProject:      CSShellExtContextMenuHandler\nCopyright (c) Microsoft Corporation.\n\nThe FileContextMenuExt.cs file defines a context menu handler by implementing the \nIShellExtInit and IContextMenu interfaces.\n\nThis source is subject to the Microsoft Public License.\nSee http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.\nAll other rights reserved.\n\nTHIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER \nEXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF \nMERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.\n\\***********************************************************************************/\n\n#region Using directives\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Runtime.InteropServices.ComTypes;\nusing System.Text;\nusing System.Windows.Forms;\nusing LECommonLibrary;\nusing IDataObject = System.Runtime.InteropServices.ComTypes.IDataObject;\n\n#endregion\n\nnamespace LEContextMenuHandler\n{\n    [ClassInterface(ClassInterfaceType.None)]\n    [Guid(\"C52B9871-E5E9-41FD-B84D-C5ACADBEC7AE\"), ComVisible(true)]\n    public class FileContextMenuExt : IShellExtInit, IContextMenu\n    {\n        // The name of the selected file.\n        private readonly IntPtr _menuBmpBlue = IntPtr.Zero;\n        private readonly IntPtr _menuBmpYellow = IntPtr.Zero;\n        private readonly List<LEMenuItem> menuItems = new List<LEMenuItem>();\n        private IntPtr _menuBmpGray = IntPtr.Zero;\n        private IntPtr _menuBmpPink = IntPtr.Zero;\n        private string _selectedFile;\n\n        public FileContextMenuExt()\n        {\n            var is4K = SystemHelper.Is4KDisplay();\n\n            //Load the bitmap for the menu item.\n            _menuBmpPink = is4K ? Resource.purple_200.GetHbitmap() : Resource.purple.GetHbitmap();\n            _menuBmpGray = is4K ? Resource.gray_200.GetHbitmap() : Resource.gray.GetHbitmap();\n            _menuBmpBlue = is4K ? Resource.blue_200.GetHbitmap() : Resource.blue.GetHbitmap();\n            _menuBmpYellow = is4K ? Resource.yellow_200.GetHbitmap() : Resource.yellow.GetHbitmap();\n\n            //Load default items.\n            menuItems.Add(new LEMenuItem(I18n.GetString(\"Submenu\"), true, null, _menuBmpYellow, \"\"));\n            menuItems.Add(new LEMenuItem(I18n.GetString(\"RunDefault\"), true, null, _menuBmpYellow, \"-run \\\"%APP%\\\"\"));\n            menuItems.Add(new LEMenuItem(I18n.GetString(\"ManageApp\"), true, null, _menuBmpGray, \"-manage \\\"%APP%\\\"\"));\n            menuItems.Add(new LEMenuItem(I18n.GetString(\"ManageAll\"), true, null, _menuBmpBlue, \"-global\"));\n\n            //If global config does not exist, create a new one.\n            LEConfig.CheckGlobalConfigFile(true);\n\n            //Load global profiles.\n            Array.ForEach(LEConfig.GetProfiles(),\n                          p =>\n                          menuItems.Add(new LEMenuItem(p.Name,\n                                                       true,\n                                                       p.ShowInMainMenu,\n                                                       _menuBmpPink,\n                                                       $\"-runas \\\"{p.Guid}\\\" \\\"%APP%\\\"\")));\n        }\n\n        #region IShellExtInit Members\n\n        /// <summary>\n        ///     Initialize the context menu handler.\n        /// </summary>\n        /// <param name=\"pidlFolder\">\n        ///     A pointer to an ITEMIDLIST structure that uniquely identifies a folder.\n        /// </param>\n        /// <param name=\"pDataObj\">\n        ///     A pointer to an IDataObject interface object that can be used to retrieve\n        ///     the objects being acted upon.\n        /// </param>\n        /// <param name=\"hKeyProgId\">\n        ///     The registry key for the file object or folder type.\n        /// </param>\n        public void Initialize(IntPtr pidlFolder, IntPtr pDataObj, IntPtr hKeyProgId)\n        {\n            if (pDataObj == IntPtr.Zero)\n            {\n                throw new ArgumentException();\n            }\n\n            var fe = new FORMATETC\n                     {\n                         cfFormat = (short)CLIPFORMAT.CF_HDROP,\n                         ptd = IntPtr.Zero,\n                         dwAspect = DVASPECT.DVASPECT_CONTENT,\n                         lindex = -1,\n                         tymed = TYMED.TYMED_HGLOBAL\n                     };\n            STGMEDIUM stm;\n\n            // The pDataObj pointer contains the objects being acted upon. In this \n            // example, we get an HDROP handle for enumerating the selected files \n            // and folders.\n            var dataObject = (IDataObject)Marshal.GetObjectForIUnknown(pDataObj);\n            dataObject.GetData(ref fe, out stm);\n\n            try\n            {\n                // Get an HDROP handle.\n                var hDrop = stm.unionmember;\n                if (hDrop == IntPtr.Zero)\n                {\n                    throw new ArgumentException();\n                }\n\n                // Determine how many files are involved in this operation.\n                var nFiles = NativeMethods.DragQueryFile(hDrop, uint.MaxValue, null, 0);\n\n                // This code sample displays the custom context menu item when only \n                // one file is selected. \n                if (nFiles == 1)\n                {\n                    // Get the path of the file.\n                    var fileName = new StringBuilder(260);\n                    if (0 == NativeMethods.DragQueryFile(hDrop,\n                                                         0,\n                                                         fileName,\n                                                         fileName.Capacity))\n                    {\n                        Marshal.ThrowExceptionForHR(WinError.E_FAIL);\n                    }\n\n                    _selectedFile = fileName.ToString();\n\n                    // Check exe binary type\n                    var path = string.Empty;\n                    var ext = Path.GetExtension(_selectedFile).ToLower();\n\n                    if (ext == \".exe\")\n                    {\n                        path = _selectedFile;\n                    }\n                    else\n                    {\n                        path = AssociationReader.HaveAssociatedProgram(ext)\n                                   ? AssociationReader.GetAssociatedProgram(ext)[0]\n                                   : string.Empty;\n\n                        if (SystemHelper.Is64BitOS())\n                        {\n                            path = SystemHelper.RedirectToWow64(path);\n                        }\n                    }\n                    // Do not display context menus for 64bit exe.\n                    switch (PEFileReader.GetPEType(path))\n                    {\n                        case PEType.Unknown:\n                        case PEType.X64:\n                            Marshal.ThrowExceptionForHR(WinError.E_FAIL);\n                            break;\n                        case PEType.X32:\n                            break;\n                    }\n                }\n                else\n                {\n                    Marshal.ThrowExceptionForHR(WinError.E_FAIL);\n                }\n            }\n            finally\n            {\n                NativeMethods.ReleaseStgMedium(ref stm);\n            }\n        }\n\n        #endregion\n\n        ~FileContextMenuExt()\n        {\n            if (_menuBmpPink != IntPtr.Zero)\n            {\n                NativeMethods.DeleteObject(_menuBmpPink);\n                _menuBmpPink = IntPtr.Zero;\n            }\n            if (_menuBmpGray != IntPtr.Zero)\n            {\n                NativeMethods.DeleteObject(_menuBmpGray);\n                _menuBmpGray = IntPtr.Zero;\n            }\n        }\n\n        private void OnVerbDisplayFileName(string cmd)\n        {\n            Process.Start(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), \"LEProc.exe\"),\n                          cmd.Replace(\"%APP%\", _selectedFile));\n        }\n\n        private int RegisterMenuItem(uint id,\n                                     uint idCmdFirst,\n                                     string text,\n                                     bool enabled,\n                                     IntPtr bitmap,\n                                     IntPtr subMenu,\n                                     uint position,\n                                     IntPtr registerTo)\n        {\n            var sub = new MENUITEMINFO();\n            sub.cbSize = (uint)Marshal.SizeOf(sub);\n\n            var m = MIIM.MIIM_STRING | MIIM.MIIM_FTYPE | MIIM.MIIM_ID | MIIM.MIIM_STATE;\n            if (bitmap != IntPtr.Zero)\n                m |= MIIM.MIIM_BITMAP;\n            if (subMenu != IntPtr.Zero)\n                m |= MIIM.MIIM_SUBMENU;\n            sub.fMask = m;\n\n            sub.wID = idCmdFirst + id;\n            sub.fType = MFT.MFT_STRING;\n            sub.dwTypeData = text;\n            sub.hSubMenu = subMenu;\n            sub.fState = enabled ? MFS.MFS_ENABLED : MFS.MFS_DISABLED;\n            sub.hbmpItem = bitmap;\n\n            if (!NativeMethods.InsertMenuItem(registerTo, position, true, ref sub))\n                return Marshal.GetHRForLastWin32Error();\n            return 0;\n        }\n\n        #region Shell Extension Registration\n\n        [ComRegisterFunction]\n        public static void Register(Type t)\n        {\n        }\n\n        [ComUnregisterFunction]\n        public static void Unregister(Type t)\n        {\n        }\n\n        #endregion\n\n        #region IContextMenu Members\n\n        /// <summary>\n        ///     Add commands to a shortcut menu.\n        /// </summary>\n        /// <param name=\"hMenu\">A handle to the shortcut menu.</param>\n        /// <param name=\"iMenu\">\n        ///     The zero-based position at which to insert the first new menu item.\n        /// </param>\n        /// <param name=\"idCmdFirst\">\n        ///     The minimum value that the handler can specify for a menu item ID.\n        /// </param>\n        /// <param name=\"idCmdLast\">\n        ///     The maximum value that the handler can specify for a menu item ID.\n        /// </param>\n        /// <param name=\"uFlags\">\n        ///     Optional flags that specify how the shortcut menu can be changed.\n        /// </param>\n        /// <returns>\n        ///     If successful, returns an HRESULT value that has its severity value set\n        ///     to SEVERITY_SUCCESS and its code value set to the offset of the largest\n        ///     command identifier that was assigned, plus one.\n        /// </returns>\n        public int QueryContextMenu(\n            IntPtr hMenu,\n            uint iMenu,\n            uint idCmdFirst,\n            uint idCmdLast,\n            uint uFlags)\n        {\n            // If uFlags include CMF_DEFAULTONLY then we should not do anything.\n            if (((uint)CMF.CMF_DEFAULTONLY & uFlags) != 0)\n            {\n                return WinError.MAKE_HRESULT(WinError.SEVERITY_SUCCESS, 0, 0);\n            }\n\n            // Add a separator.\n            var sep = new MENUITEMINFO();\n            sep.cbSize = (uint)Marshal.SizeOf(sep);\n            sep.fMask = MIIM.MIIM_TYPE;\n            sep.fType = MFT.MFT_SEPARATOR;\n            if (!NativeMethods.InsertMenuItem(hMenu, 0, true, ref sep))\n                return Marshal.GetHRForLastWin32Error();\n\n            // Register item 0: Submenu\n            var hSubMenu = NativeMethods.CreatePopupMenu();\n            var item = menuItems[0];\n            RegisterMenuItem(0, idCmdFirst, item.Text, true, item.Bitmap, hSubMenu, 1, hMenu);\n\n            // Register item 1: RunDefault\n            item = menuItems[1];\n            RegisterMenuItem(1, idCmdFirst, item.Text, true, item.Bitmap, IntPtr.Zero, 0, hSubMenu);\n\n            // Add a separator.\n            sep = new MENUITEMINFO();\n            sep.cbSize = (uint)Marshal.SizeOf(sep);\n            sep.fMask = MIIM.MIIM_TYPE;\n            sep.fType = MFT.MFT_SEPARATOR;\n            NativeMethods.InsertMenuItem(hSubMenu, 1, true, ref sep);\n\n            // Register item 2 (Submenu->ManageApp).\n            item = menuItems[2];\n            RegisterMenuItem(2, idCmdFirst, item.Text, true, item.Bitmap, IntPtr.Zero, 2, hSubMenu);\n\n            // Register item 3 (Submenu->ManageAll).\n            item = menuItems[3];\n            RegisterMenuItem(3, idCmdFirst, item.Text, true, item.Bitmap, IntPtr.Zero, 3, hSubMenu);\n\n            //Register user-defined profiles.\n            //We should count down to 4.\n            for (var i = menuItems.Count - 1; i > 3; i--)\n            {\n                item = menuItems[i];\n                if (item.ShowInMainMenu == true)\n                {\n                    RegisterMenuItem((uint)i, idCmdFirst, item.Text, item.Enabled, item.Bitmap, IntPtr.Zero, 1, hMenu);\n                }\n                else\n                {\n                    RegisterMenuItem((uint)i, idCmdFirst, item.Text, item.Enabled, item.Bitmap, IntPtr.Zero, 0, hSubMenu);\n                }\n            }\n\n            // Add a separator.\n            sep = new MENUITEMINFO();\n            sep.cbSize = (uint)Marshal.SizeOf(sep);\n            sep.fMask = MIIM.MIIM_TYPE;\n            sep.fType = MFT.MFT_SEPARATOR;\n            NativeMethods.InsertMenuItem(hSubMenu,\n                                         (uint)menuItems.FindAll(t => t.ShowInMainMenu != true).Count - 4,\n                                         true,\n                                         ref sep);\n\n            // Return an HRESULT value with the severity set to SEVERITY_SUCCESS. \n            // Set the code value to the total number of items added.\n            return WinError.MAKE_HRESULT(WinError.SEVERITY_SUCCESS, 0, 3 + (uint)menuItems.Count);\n        }\n\n        /// <summary>\n        ///     Carry out the command associated with a shortcut menu item.\n        /// </summary>\n        /// <param name=\"pici\">\n        ///     A pointer to a CMINVOKECOMMANDINFO or CMINVOKECOMMANDINFOEX structure\n        ///     containing information about the command.\n        /// </param>\n        public void InvokeCommand(IntPtr pici)\n        {\n            var ici = (CMINVOKECOMMANDINFO)Marshal.PtrToStructure(pici, typeof (CMINVOKECOMMANDINFO));\n\n            var item = menuItems[NativeMethods.LowWord(ici.verb.ToInt32())];\n\n            OnVerbDisplayFileName(item.Commands);\n        }\n\n        /// <summary>\n        ///     Get information about a shortcut menu command, including the help string\n        ///     and the language-independent, or canonical, name for the command.\n        /// </summary>\n        /// <param name=\"idCmd\">Menu command identifier offset.</param>\n        /// <param name=\"uFlags\">\n        ///     Flags specifying the information to return. This parameter can have one\n        ///     of the following values: GCS_HELPTEXTA, GCS_HELPTEXTW, GCS_VALIDATEA,\n        ///     GCS_VALIDATEW, GCS_VERBA, GCS_VERBW.\n        /// </param>\n        /// <param name=\"pReserved\">Reserved. Must be IntPtr.Zero</param>\n        /// <param name=\"pszName\">\n        ///     The address of the buffer to receive the null-terminated string being\n        ///     retrieved.\n        /// </param>\n        /// <param name=\"cchMax\">\n        ///     Size of the buffer, in characters, to receive the null-terminated string.\n        /// </param>\n        public void GetCommandString(\n            UIntPtr idCmd,\n            uint uFlags,\n            IntPtr pReserved,\n            StringBuilder pszName,\n            uint cchMax)\n        {\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "LEContextMenuHandler/I18n.cs",
    "content": "﻿using System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Xml;\nusing System.Xml.Linq;\n\nnamespace LEContextMenuHandler\n{\n    internal class I18n\n    {\n        internal static readonly CultureInfo CurrentCultureInfo = CultureInfo.CurrentUICulture;\n        //internal static readonly CultureInfo CurrentCultureInfo = CultureInfo.GetCultureInfo(\"zh-CN\");\n\n        private static XDocument cacheDictionary;\n\n        internal static string GetString(string key)\n        {\n            var dict = LoadDictionary();\n            try\n            {\n                var strings = from i in dict.Descendants(\"Strings\").Elements() select i;\n\n                var str = (from s in strings where s.Name == key select s.Value).FirstOrDefault();\n\n                if (string.IsNullOrEmpty(str))\n                    return key;\n\n                return str;\n            }\n            catch\n            {\n                return key;\n            }\n        }\n\n        private static XDocument LoadDictionary()\n        {\n            if (cacheDictionary != null)\n                return cacheDictionary;\n\n            XDocument dictionary = null;\n            try\n            {\n                var langDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @\"Lang\\\");\n\n                var firstLangPath = Path.Combine(langDir,CurrentCultureInfo.Name + \".xml\");\n                var fallbackLangPath = Path.Combine(langDir,\n                                                    $@\"{CurrentCultureInfo.TwoLetterISOLanguageName}.xml\");\n\n                dictionary = XDocument.Load(File.Exists(firstLangPath) ? firstLangPath : fallbackLangPath);\n            }\n            catch\n            {\n            }\n\n            //If dictionary is still null, use default language.\n            if (dictionary == null)\n                dictionary = XDocument.Load(new XmlTextReader(new StringReader(Resource.DefaultLanguage)));\n\n            cacheDictionary = dictionary;\n\n            return cacheDictionary;\n        }\n    }\n}"
  },
  {
    "path": "LEContextMenuHandler/LEContextMenuHandler.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{0041073D-2FA7-4B35-B904-9C606C89C8CD}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>LEContextMenuHandler</RootNamespace>\n    <AssemblyName>LEContextMenuHandler</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\Build\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\Build\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup>\n    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Configuration.Install\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"FileContextMenuExt.cs\" />\n    <Compile Include=\"I18n.cs\" />\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"ProjectInstaller.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Resource.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resource.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"ShellExtLib.cs\" />\n    <Compile Include=\"LEMenuItem.cs\" />\n    <Compile Include=\"WinError.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Resource.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resource.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"key.snk\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Resources\\Blue%40200.bmp\" />\n    <Content Include=\"Resources\\blue.bmp\" />\n    <None Include=\"Resources\\Gray%40200.bmp\" />\n    <Content Include=\"Resources\\gray.bmp\" />\n    <None Include=\"Resources\\purple%40200.bmp\" />\n    <Content Include=\"Resources\\purple.bmp\" />\n    <None Include=\"Resources\\yellow%40200.bmp\" />\n    <Content Include=\"Resources\\yellow.bmp\" />\n    <None Include=\"Lang\\DefaultLanguage.xml\">\n      <SubType>Designer</SubType>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\LECommonLibrary\\LECommonLibrary.csproj\">\n      <Project>{c4def32b-8fbb-41b6-80dc-c60339402323}</Project>\n      <Name>LECommonLibrary</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <PropertyGroup>\n    <PreBuildEvent>\n    </PreBuildEvent>\n  </PropertyGroup>\n  <PropertyGroup>\n    <PostBuildEvent>mkdir \"$(TargetDir)Lang\\\"\ncopy /Y \"$(ProjectDir)Lang\\*.xml\" \"$(TargetDir)Lang\\\"\ncopy /Y \"$(TargetPath)\" \"$(SolutionDir)LEInstaller\\Resources\\\"\n</PostBuildEvent>\n  </PropertyGroup>\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "LEContextMenuHandler/LEMenuItem.cs",
    "content": "﻿using System;\n\nnamespace LEContextMenuHandler\n{\n    internal struct LEMenuItem\n    {\n        internal IntPtr Bitmap;\n        internal string Commands;\n        internal bool? ShowInMainMenu;\n        internal string Text;\n        internal bool Enabled;\n\n        internal LEMenuItem(string text, bool enabled, bool? showInMainMenu, IntPtr bitmap, string commands)\n        {\n            ShowInMainMenu = showInMainMenu;\n            Text = text;\n            Enabled = enabled;\n            Bitmap = bitmap;\n            Commands = commands;\n        }\n    }\n}"
  },
  {
    "path": "LEContextMenuHandler/Lang/DefaultLanguage.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Run with Application Profile</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Modify Application Profile</ManageApp>\n  <ManageAll>Edit Global Profile List</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/ca.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Executar amb el Perfil de l'Aplicació</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Modificar Perfil de l'Aplicació</ManageApp>\n  <ManageAll>Editar la Llista Global de Perfils</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/cs.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Spustit s profilem aplikace</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Změnit profil aplikace</ManageApp>\n  <ManageAll>Upravit seznam globálních profilů</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/de.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Mit Anwendungsprofil ausführen</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Anwendungsprofil ändern</ManageApp>\n  <ManageAll>Globale Profilliste verwalten</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/es.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Ejecutar con el Perfil de la Aplicación</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Modificar el Perfil de la Aplicación</ManageApp>\n  <ManageAll>Editar la lista de Perfiles Globales</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/fr.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Éxecuter avec le profil de cette application</RunDefault>\n  <Submenu>Émulateur local</Submenu>\n  <ManageApp>Modifier le profil de cette application</ManageApp>\n  <ManageAll>Gestion du profil global</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/ind.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Jalankan dengan Profil Aplikasi</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Ubah Profil Aplikasi</ManageApp>\n  <ManageAll>Ubah daftar profil global</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/it.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Avvia con Profilo dell'Applicazione</RunDefault>\n  <Submenu>Emulatore Locale</Submenu>\n  <ManageApp>Modifica Profili dell'Applicazione</ManageApp>\n  <ManageAll>Modifica Lista Profili Globali</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/ja.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>プロファイルで実行</RunDefault>\n  <Submenu>ロケールエミュレータ</Submenu>\n  <ManageApp>プロファイルを変更</ManageApp>\n  <ManageAll>汎用性プロファイルリストを編集</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/ka.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>აპლიკაციის პროფილით გაშვება</RunDefault>\n  <Submenu>ლოკალის ემულატორი</Submenu>\n  <ManageApp>აპლიკაციის პროფილის ცვლილება</ManageApp>\n  <ManageAll>პროფილების საერთო სიის შეცვლა</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/ko.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Strings>\n  <RunDefault>애플리케이션 프로필로 실행</RunDefault>\n  <Submenu>로케일 에뮬레이터</Submenu>\n  <ManageApp>애플리케이션 프로필 수정</ManageApp>\n  <ManageAll>글로벌 프로필 목록을 편집</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/lt.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Paleisti su programos profiliu</RunDefault>\n  <Submenu>Lokalės emuliatorius</Submenu>\n  <ManageApp>Redaguoti programos profilį</ManageApp>\n  <ManageAll>Redaguoti bendrųjų profilų sąrašą</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/nb.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Kjør med programmets profil</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Endre på programprofilen</ManageApp>\n  <ManageAll>Rediger den generelle profillisten</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/nl.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n<Strings>\r\n  <RunDefault>Uitvoeren met applicatieprofiel</RunDefault>\r\n  <Submenu>Landinstellingen emulator</Submenu>\r\n  <ManageApp>Applicatieprofiel wijzigen</ManageApp>\r\n  <ManageAll>Algemene profiellijst wijzigen</ManageAll>\r\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/pl.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Uruchom z Profilem Aplikacji</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Zmodyfikuj Profil Aplikacji</ManageApp>\n  <ManageAll>Edytuj Ogólną Listę Profili</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/pt-BR.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Executar com Perfil de Aplicativo</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Modificar Perfil de Aplicativo</ManageApp>\n  <ManageAll>Editar lista Global de Perfis</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/ru.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Запустить с профилем приложения</RunDefault>\n  <Submenu>Эмулятор локали</Submenu>\n  <ManageApp>Изменить профиль приложения</ManageApp>\n  <ManageAll>Изменить общий список профилей</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/th.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>เปิดด้วยโปรไฟล์แอป</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>แก้ไขโปรไฟล์แอป</ManageApp>\n  <ManageAll>แก้ไขโปรไฟล์โดยรวม</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/tr-TR.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>Uygulama Profili İle Çalıştır</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>Uygulama Profilini Değiştir</ManageApp>\n  <ManageAll>Global Profil Listesini Düzenle</ManageAll>\n</Strings>\n"
  },
  {
    "path": "LEContextMenuHandler/Lang/zh-CN.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>以此程序配置运行</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>修改此程序的配置</ManageApp>\n  <ManageAll>管理通用配置列表</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/zh-HK.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>以此程式設定執行</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>修改此程式的設定</ManageApp>\n  <ManageAll>管理通用設定清單</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/Lang/zh-TW.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Strings>\n  <RunDefault>以此程式設定執行</RunDefault>\n  <Submenu>Locale Emulator</Submenu>\n  <ManageApp>修改此程式的設定</ManageApp>\n  <ManageAll>管理通用設定清單</ManageAll>\n</Strings>"
  },
  {
    "path": "LEContextMenuHandler/NativeMethods.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\nusing System.Runtime.InteropServices.ComTypes;\nusing System.Text;\n\nnamespace LEContextMenuHandler\n{\n    internal class NativeMethods\n    {\n        /// <summary>\n        ///     Retrieve the names of dropped files that result from a successful drag-\n        ///     and-drop operation.\n        /// </summary>\n        /// <param name=\"hDrop\">\n        ///     Identifier of the structure that contains the file names of the dropped\n        ///     files.\n        /// </param>\n        /// <param name=\"iFile\">\n        ///     Index of the file to query. If the value of this parameter is 0xFFFFFFFF,\n        ///     DragQueryFile returns a count of the files dropped.\n        /// </param>\n        /// <param name=\"pszFile\">\n        ///     The address of a buffer that receives the file name of a dropped file\n        ///     when the function returns.\n        /// </param>\n        /// <param name=\"cch\">\n        ///     The size, in characters, of the pszFile buffer.\n        /// </param>\n        /// <returns>A non-zero value indicates a successful call.</returns>\n        [DllImport(\"shell32\", CharSet = CharSet.Unicode)]\n        public static extern uint DragQueryFile(\n            IntPtr hDrop,\n            uint iFile,\n            StringBuilder pszFile,\n            int cch);\n\n        /// <summary>\n        ///     Free the specified storage medium.\n        /// </summary>\n        /// <param name=\"pmedium\">\n        ///     Reference of the storage medium that is to be freed.\n        /// </param>\n        [DllImport(\"ole32.dll\", CharSet = CharSet.Unicode)]\n        public static extern void ReleaseStgMedium(ref STGMEDIUM pmedium);\n\n        /// <summary>\n        ///     Insert a new menu item at the specified position in a menu.\n        /// </summary>\n        /// <param name=\"hMenu\">\n        ///     A handle to the menu in which the new menu item is inserted.\n        /// </param>\n        /// <param name=\"uItem\">\n        ///     The identifier or position of the menu item before which to insert the\n        ///     new item. The meaning of this parameter depends on the value of\n        ///     fByPosition.\n        /// </param>\n        /// <param name=\"fByPosition\">\n        ///     Controls the meaning of uItem. If this parameter is false, uItem is a\n        ///     menu item identifier. Otherwise, it is a menu item position.\n        /// </param>\n        /// <param name=\"mii\">\n        ///     A reference of a MENUITEMINFO structure that contains information about\n        ///     the new menu item.\n        /// </param>\n        /// <returns>\n        ///     If the function succeeds, the return value is true.\n        /// </returns>\n        [DllImport(\"user32\", CharSet = CharSet.Unicode, SetLastError = true)]\n        [return: MarshalAs(UnmanagedType.Bool)]\n        public static extern bool InsertMenuItem(\n            IntPtr hMenu,\n            uint uItem,\n            [MarshalAs(UnmanagedType.Bool)] bool fByPosition,\n            ref MENUITEMINFO mii);\n\n        [DllImport(\"user32.dll\", CharSet = CharSet.Unicode, SetLastError = true)]\n        public static extern IntPtr CreatePopupMenu();\n\n        /// <summary>\n        ///     The DeleteObject function deletes a logical pen, brush, font, bitmap,\n        ///     region, or palette, freeing all system resources associated with the\n        ///     object. After the object is deleted, the specified handle is no longer\n        ///     valid.\n        /// </summary>\n        /// <param name=\"hObject\">\n        ///     A handle to a logical pen, brush, font, bitmap, region, or palette.\n        /// </param>\n        /// <returns>\n        ///     If the function succeeds, the return value is true.\n        /// </returns>\n        [DllImport(\"gdi32.dll\", CharSet = CharSet.Unicode, SetLastError = true)]\n        public static extern bool DeleteObject(IntPtr hObject);\n\n        public static int HighWord(int number)\n        {\n            return (number & 0x80000000) == 0x80000000\n                       ? number >> 16\n                       : (number >> 16) & 0xffff;\n        }\n\n        public static int LowWord(int number)\n        {\n            return number & 0xffff;\n        }\n    }\n}"
  },
  {
    "path": "LEContextMenuHandler/ProjectInstaller.cs",
    "content": "﻿/********************************** Module Header **********************************\\\nModule Name:  ProjectInstaller.cs\nProject:      CSShellExtContextMenuHandler\nCopyright (c) Microsoft Corporation.\n\nThe installer class defines the custom actions in the setup. We use the custom \nactions to register and unregister the COM-visible classes in the current managed \nassembly.\n\nThis source is subject to the Microsoft Public License.\nSee http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.\nAll other rights reserved.\n\nTHIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER \nEXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF \nMERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.\n\\***********************************************************************************/\n\n#region Using directives\n\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Configuration.Install;\nusing System.Runtime.InteropServices;\n\n#endregion\n\nnamespace LEContextMenuHandler\n{\n    [RunInstaller(true), ComVisible(false)]\n    public class ProjectInstaller : Installer\n    {\n        public override void Install(IDictionary stateSaver)\n        {\n            base.Install(stateSaver);\n\n            // Call RegistrationServices.RegisterAssembly to register the classes in \n            // the current managed assembly to enable creation from COM.\n            var regService = new RegistrationServices();\n            regService.RegisterAssembly(GetType().Assembly, AssemblyRegistrationFlags.SetCodeBase);\n        }\n\n        public override void Uninstall(IDictionary savedState)\n        {\n            base.Uninstall(savedState);\n\n            // Call RegistrationServices.UnregisterAssembly to unregister the classes \n            // in the current managed assembly.\n            var regService = new RegistrationServices();\n            regService.UnregisterAssembly(GetType().Assembly);\n        }\n    }\n}"
  },
  {
    "path": "LEContextMenuHandler/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"LEContextMenuHandler\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Paddy Xu\")]\n[assembly: AssemblyProduct(\"Context Menu Handler for LocaleEmulator\")]\n[assembly: AssemblyCopyright(\"Copyright © Paddy Xu 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"dc726d09-9f07-42d1-9093-e33e18c4d266\")]"
  },
  {
    "path": "LEContextMenuHandler/Resource.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEContextMenuHandler {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resource {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resource() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"LEContextMenuHandler.Resource\", typeof(Resource).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap blue {\n            get {\n                object obj = ResourceManager.GetObject(\"blue\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap blue_200 {\n            get {\n                object obj = ResourceManager.GetObject(\"blue_200\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n        ///\n        ///&lt;Strings&gt;\n        ///  &lt;RunDefault&gt;Run with Application Profile&lt;/RunDefault&gt;\n        ///  &lt;Submenu&gt;Locale Emulator&lt;/Submenu&gt;\n        ///  &lt;ManageApp&gt;Modify Application Profile&lt;/ManageApp&gt;\n        ///  &lt;ManageAll&gt;Edit Global Profile List&lt;/ManageAll&gt;\n        ///&lt;/Strings&gt;.\n        /// </summary>\n        internal static string DefaultLanguage {\n            get {\n                return ResourceManager.GetString(\"DefaultLanguage\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap gray {\n            get {\n                object obj = ResourceManager.GetObject(\"gray\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap gray_200 {\n            get {\n                object obj = ResourceManager.GetObject(\"gray_200\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap purple {\n            get {\n                object obj = ResourceManager.GetObject(\"purple\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap purple_200 {\n            get {\n                object obj = ResourceManager.GetObject(\"purple_200\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap yellow {\n            get {\n                object obj = ResourceManager.GetObject(\"yellow\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Bitmap.\n        /// </summary>\n        internal static System.Drawing.Bitmap yellow_200 {\n            get {\n                object obj = ResourceManager.GetObject(\"yellow_200\", resourceCulture);\n                return ((System.Drawing.Bitmap)(obj));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEContextMenuHandler/Resource.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"blue\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\Blue.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"DefaultLanguage\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>lang\\defaultlanguage.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>\n  </data>\n  <data name=\"gray\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\Gray.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"purple\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>resources\\purple.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"yellow\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\yellow.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"blue_200\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\blue@200.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"gray_200\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\gray@200.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"purple_200\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\purple@200.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n  <data name=\"yellow_200\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>Resources\\yellow@200.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n</root>"
  },
  {
    "path": "LEContextMenuHandler/ShellExtLib.cs",
    "content": "﻿/********************************** Module Header **********************************\\\nModule Name:  ShellExtLib.cs\nProject:      CSShellExtContextMenuHandler\nCopyright (c) Microsoft Corporation.\n\nThe file declares the imported Shell interfaces: IShellExtInit and IContextMenu, \nimplements the helper functions for registering and unregistering a shell context \nmenu handler, and declares the Win32 enums, structs, consts, and functions used by \nthe code sample.\n\nThis source is subject to the Microsoft Public License.\nSee http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.\nAll other rights reserved.\n\nTHIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER \nEXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF \nMERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.\n\\***********************************************************************************/\n\n#region Using directives\n\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing Microsoft.Win32;\n\n#endregion\n\nnamespace LEContextMenuHandler\n{\n\n    #region Shell Interfaces\n\n    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]\n    [Guid(\"000214e8-0000-0000-c000-000000000046\")]\n    internal interface IShellExtInit\n    {\n        void Initialize(\n            IntPtr /*LPCITEMIDLIST*/ pidlFolder,\n            IntPtr /*LPDATAOBJECT*/ pDataObj,\n            IntPtr /*HKEY*/ hKeyProgId);\n    }\n\n    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]\n    [Guid(\"000214e4-0000-0000-c000-000000000046\")]\n    internal interface IContextMenu\n    {\n        [PreserveSig]\n        int QueryContextMenu(\n            IntPtr /*HMENU*/ hMenu,\n            uint iMenu,\n            uint idCmdFirst,\n            uint idCmdLast,\n            uint uFlags);\n\n        void InvokeCommand(IntPtr pici);\n\n        void GetCommandString(\n            UIntPtr idCmd,\n            uint uFlags,\n            IntPtr pReserved,\n            StringBuilder pszName,\n            uint cchMax);\n    }\n\n    #endregion\n\n    #region Enums & Structs\n\n    internal enum GCS : uint\n    {\n        GCS_VERBA = 0x00000000,\n        GCS_HELPTEXTA = 0x00000001,\n        GCS_VALIDATEA = 0x00000002,\n        GCS_VERBW = 0x00000004,\n        GCS_HELPTEXTW = 0x00000005,\n        GCS_VALIDATEW = 0x00000006,\n        GCS_VERBICONW = 0x00000014,\n        GCS_UNICODE = 0x00000004\n    }\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]\n    internal struct CMINVOKECOMMANDINFO\n    {\n        public uint cbSize;\n        public CMIC fMask;\n        public IntPtr hwnd;\n        public IntPtr verb;\n        [MarshalAs(UnmanagedType.LPStr)] public string parameters;\n        [MarshalAs(UnmanagedType.LPStr)] public string directory;\n        public int nShow;\n        public uint dwHotKey;\n        public IntPtr hIcon;\n    }\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]\n    internal struct CMINVOKECOMMANDINFOEX\n    {\n        public uint cbSize;\n        public CMIC fMask;\n        public IntPtr hwnd;\n        public IntPtr verb;\n        [MarshalAs(UnmanagedType.LPStr)] public string parameters;\n        [MarshalAs(UnmanagedType.LPStr)] public string directory;\n        public int nShow;\n        public uint dwHotKey;\n        public IntPtr hIcon;\n        [MarshalAs(UnmanagedType.LPStr)] public string title;\n        public IntPtr verbW;\n        public string parametersW;\n        public string directoryW;\n        public string titleW;\n        private readonly POINT ptInvoke;\n    }\n\n    [Flags]\n    internal enum CMIC : uint\n    {\n        CMIC_MASK_ICON = 0x00000010,\n        CMIC_MASK_HOTKEY = 0x00000020,\n        CMIC_MASK_NOASYNC = 0x00000100,\n        CMIC_MASK_FLAG_NO_UI = 0x00000400,\n        CMIC_MASK_UNICODE = 0x00004000,\n        CMIC_MASK_NO_CONSOLE = 0x00008000,\n        CMIC_MASK_ASYNCOK = 0x00100000,\n        CMIC_MASK_NOZONECHECKS = 0x00800000,\n        CMIC_MASK_FLAG_LOG_USAGE = 0x04000000,\n        CMIC_MASK_SHIFT_DOWN = 0x10000000,\n        CMIC_MASK_PTINVOKE = 0x20000000,\n        CMIC_MASK_CONTROL_DOWN = 0x40000000\n    }\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]\n    public struct POINT\n    {\n        public int X;\n        public int Y;\n    }\n\n    internal enum CLIPFORMAT : uint\n    {\n        CF_TEXT = 1,\n        CF_BITMAP = 2,\n        CF_METAFILEPICT = 3,\n        CF_SYLK = 4,\n        CF_DIF = 5,\n        CF_TIFF = 6,\n        CF_OEMTEXT = 7,\n        CF_DIB = 8,\n        CF_PALETTE = 9,\n        CF_PENDATA = 10,\n        CF_RIFF = 11,\n        CF_WAVE = 12,\n        CF_UNICODETEXT = 13,\n        CF_ENHMETAFILE = 14,\n        CF_HDROP = 15,\n        CF_LOCALE = 16,\n        CF_MAX = 17,\n\n        CF_OWNERDISPLAY = 0x0080,\n        CF_DSPTEXT = 0x0081,\n        CF_DSPBITMAP = 0x0082,\n        CF_DSPMETAFILEPICT = 0x0083,\n        CF_DSPENHMETAFILE = 0x008E,\n\n        CF_PRIVATEFIRST = 0x0200,\n        CF_PRIVATELAST = 0x02FF,\n\n        CF_GDIOBJFIRST = 0x0300,\n        CF_GDIOBJLAST = 0x03FF\n    }\n\n    [Flags]\n    internal enum CMF : uint\n    {\n        CMF_NORMAL = 0x00000000,\n        CMF_DEFAULTONLY = 0x00000001,\n        CMF_VERBSONLY = 0x00000002,\n        CMF_EXPLORE = 0x00000004,\n        CMF_NOVERBS = 0x00000008,\n        CMF_CANRENAME = 0x00000010,\n        CMF_NODEFAULT = 0x00000020,\n        CMF_INCLUDESTATIC = 0x00000040,\n        CMF_ITEMMENU = 0x00000080,\n        CMF_EXTENDEDVERBS = 0x00000100,\n        CMF_DISABLEDVERBS = 0x00000200,\n        CMF_ASYNCVERBSTATE = 0x00000400,\n        CMF_OPTIMIZEFORINVOKE = 0x00000800,\n        CMF_SYNCCASCADEMENU = 0x00001000,\n        CMF_DONOTPICKDEFAULT = 0x00002000,\n        CMF_RESERVED = 0xFFFF0000\n    }\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]\n    internal struct MENUITEMINFO\n    {\n        public uint cbSize;\n        public MIIM fMask;\n        public MFT fType;\n        public MFS fState;\n        public uint wID;\n        public IntPtr hSubMenu;\n        public IntPtr hbmpChecked;\n        public IntPtr hbmpUnchecked;\n        public UIntPtr dwItemData;\n        [MarshalAs(UnmanagedType.LPTStr)] public string dwTypeData;\n        public uint cch;\n        public IntPtr hbmpItem;\n    }\n\n    [Flags]\n    internal enum MIIM : uint\n    {\n        MIIM_STATE = 0x00000001,\n        MIIM_ID = 0x00000002,\n        MIIM_SUBMENU = 0x00000004,\n        MIIM_CHECKMARKS = 0x00000008,\n        MIIM_TYPE = 0x00000010,\n        MIIM_DATA = 0x00000020,\n        MIIM_STRING = 0x00000040,\n        MIIM_BITMAP = 0x00000080,\n        MIIM_FTYPE = 0x00000100\n    }\n\n    internal enum MFT : uint\n    {\n        MFT_STRING = 0x00000000,\n        MFT_BITMAP = 0x00000004,\n        MFT_MENUBARBREAK = 0x00000020,\n        MFT_MENUBREAK = 0x00000040,\n        MFT_OWNERDRAW = 0x00000100,\n        MFT_RADIOCHECK = 0x00000200,\n        MFT_SEPARATOR = 0x00000800,\n        MFT_RIGHTORDER = 0x00002000,\n        MFT_RIGHTJUSTIFY = 0x00004000\n    }\n\n    internal enum MFS : uint\n    {\n        MFS_ENABLED = 0x00000000,\n        MFS_UNCHECKED = 0x00000000,\n        MFS_UNHILITE = 0x00000000,\n        MFS_GRAYED = 0x00000003,\n        MFS_DISABLED = 0x00000003,\n        MFS_CHECKED = 0x00000008,\n        MFS_HILITE = 0x00000080,\n        MFS_DEFAULT = 0x00001000\n    }\n\n    #endregion\n}"
  },
  {
    "path": "LEContextMenuHandler/WinError.cs",
    "content": "﻿namespace LEContextMenuHandler\n{\n    internal static class WinError\n    {\n        public const int S_OK = 0x0000;\n        public const int S_FALSE = 0x0001;\n        public const int E_FAIL = -2147467259;\n        public const int E_INVALIDARG = -2147024809;\n        public const int E_OUTOFMEMORY = -2147024882;\n        public const int STRSAFE_E_INSUFFICIENT_BUFFER = -2147024774;\n        public const uint SEVERITY_SUCCESS = 0;\n        public const uint SEVERITY_ERROR = 1;\n\n        /// <summary>\n        ///     Create an HRESULT value from component pieces.\n        /// </summary>\n        /// <param name=\"sev\">The severity to be used</param>\n        /// <param name=\"fac\">The facility to be used</param>\n        /// <param name=\"code\">The error number</param>\n        /// <returns>A HRESULT constructed from the above 3 values</returns>\n        public static int MAKE_HRESULT(uint sev, uint fac, uint code)\n        {\n            return (int)((sev << 31) | (fac << 16) | code);\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/App.xaml",
    "content": "﻿<Application x:Class=\"LEGUI.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             StartupUri=\"GlobalConfig.xaml\" Startup=\"App_OnStartup\">\n    <Application.Resources>\n        <ResourceDictionary>\n            <ResourceDictionary.MergedDictionaries>\n                <ResourceDictionary Source=\"Lang\\DefaultLanguage.xaml\" />\n            </ResourceDictionary.MergedDictionaries>\n        </ResourceDictionary>\n    </Application.Resources>\n</Application>"
  },
  {
    "path": "LEGUI/App.xaml.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Windows;\nusing LECommonLibrary;\n\nnamespace LEGUI\n{\n    /// <summary>\n    ///     Interaction logic for App.xaml\n    /// </summary>\n    public partial class App : Application\n    {\n        internal static string StandaloneFilePath = string.Empty;\n\n        protected override void OnStartup(StartupEventArgs e)\n        {\n            AppDomain.CurrentDomain.UnhandledException +=\n                (sender, args) => MessageBox.Show(((Exception) args.ExceptionObject).Message);\n\n            base.OnStartup(e);\n        }\n\n        private void App_OnStartup(object sender, StartupEventArgs e)\n        {\n            if (e.Args.Length != 0)\n            {\n                StandaloneFilePath = SystemHelper.EnsureAbsolutePath(e.Args[0]);\n\n                // This happens when user is trying to drop a exe onto LEGUI.\n                if (!StandaloneFilePath.EndsWith(\".le.config\", true, null))\n                    StandaloneFilePath += \".le.config\";\n            }\n\n            var isGlobalProfile = string.IsNullOrEmpty(StandaloneFilePath);\n\n            LEConfig.CheckGlobalConfigFile(true);\n\n            // We check StandaloneFilePath before loading UI, because this wil be faster.\n            if (\n                !SystemHelper.CheckPermission(isGlobalProfile\n                                                  ? Path.GetDirectoryName(LEConfig.GlobalConfigPath)\n                                                  : Path.GetDirectoryName(StandaloneFilePath)))\n            {\n                if (SystemHelper.IsAdministrator())\n                {\n                    // We can do nothing now.\n                    if (isGlobalProfile)\n                        MessageBox.Show(\n                                        \"Home directory is not writable. \\r\\n\"\n                                        + \"Please move LE to another location and try again.\\r\\n\"\n                                        + $\"Home directory: {Path.GetDirectoryName(LEConfig.GlobalConfigPath)}\",\n                                        \"Locale Emulator\",\n                                        MessageBoxButton.OK,\n                                        MessageBoxImage.Error);\n                    else\n                        MessageBox.Show(\n                                        \"The directory is not writable.\\r\\n\" + \"Please use global profile instead.\\r\\n\"\n                                        + $\"Current Directory: {Path.GetDirectoryName(StandaloneFilePath)}\",\n                                        \"Locale Emulator\",\n                                        MessageBoxButton.OK,\n                                        MessageBoxImage.Error);\n\n                    Current.Shutdown();\n                }\n                else\n                {\n                    // If we are not administrator, we can ask for administrator permission.\n                    try\n                    {\n                        SystemHelper.RunWithElevatedProcess(\n                                                            Path.Combine(\n                                                                         Path.GetDirectoryName(LEConfig.GlobalConfigPath),\n                                                                         \"LEGUI.exe\"),\n                                                            e.Args);\n                    }\n                    catch (Exception ex)\n                    {\n                        MessageBox.Show(\"LEGUI requires administrator privilege to write to the current directory.\",\n                                        \"Locale Emulator\",\n                                        MessageBoxButton.OK,\n                                        MessageBoxImage.Error);\n                    }\n                    finally\n                    {\n                        Current.Shutdown();\n                    }\n                }\n            }\n\n            I18n.LoadLanguage();\n\n            Current.StartupUri = isGlobalProfile\n                                     ? new Uri(\"GlobalConfig.xaml\", UriKind.RelativeOrAbsolute)\n                                     : new Uri(\"AppConfig.xaml\", UriKind.RelativeOrAbsolute);\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/AppConfig.xaml",
    "content": "﻿<Window x:Class=\"LEGUI.AppConfig\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:legui=\"clr-namespace:LEGUI\"\n        Title=\"LEGUI - \" Height=\"315.811\" Width=\"330.4\"\n        WindowStartupLocation=\"CenterScreen\" ResizeMode=\"CanMinimize\">\n    <Grid TextElement.FontFamily=\"{DynamicResource UIFont}\">\n        <Grid x:Name=\"mainGrid\">\n            <Grid.RowDefinitions>\n                <RowDefinition Height=\"60\" />\n                <RowDefinition />\n            </Grid.RowDefinitions>\n            <Grid x:Name=\"appConfigGrid\" Grid.Row=\"0\" Background=\"#FFF1F1F1\">\n                <Grid.RowDefinitions>\n                    <RowDefinition Height=\"1*\" />\n                    <RowDefinition Height=\"1*\" />\n                </Grid.RowDefinitions>\n                <Grid.ColumnDefinitions>\n                    <ColumnDefinition Width=\"1*\" />\n                    <ColumnDefinition Width=\"1*\" />\n                    <ColumnDefinition Width=\"1*\" />\n                </Grid.ColumnDefinitions>\n                <legui:MaskedTextBox x:Name=\"tbAppParameter\" Grid.Row=\"0\" Grid.Column=\"0\" Height=\"Auto\"\n                                     Margin=\"3,3,3,4\" MaskText=\"{StaticResource EnterArgument}\"\n                                     VerticalContentAlignment=\"Center\" Grid.ColumnSpan=\"3\" />\n                <Button x:Name=\"bSaveAppSetting\" Grid.Row=\"1\" Grid.Column=\"0\" Content=\"{DynamicResource Save}\"\n                        Margin=\"3,0,3,5\" Click=\"bSaveAppSetting_Click\" />\n                <Button x:Name=\"bShortcut\" Grid.Row=\"1\" Grid.Column=\"1\" Content=\"{DynamicResource Shortcut}\"\n                        Margin=\"3,0,3,5\" Click=\"bShortcut_Click\" />\n                <Button x:Name=\"bDeleteAppSetting\" Grid.Row=\"1\" Grid.Column=\"2\" Content=\"{DynamicResource Delete}\"\n                        Margin=\"3,0,3,5\" Click=\"bDeleteAppSetting_Click\" />\n            </Grid>\n            <Grid Grid.Row=\"1\" Margin=\"0,0,0,10\">\n                <Grid Grid.Column=\"0\">\n                    <Grid.RowDefinitions>\n                        <RowDefinition Height=\"1*\" />\n                        <RowDefinition Height=\"1*\" />\n                        <RowDefinition Height=\"2*\" />\n                    </Grid.RowDefinitions>\n                    <GroupBox Grid.Row=\"0\" Header=\"{DynamicResource LocationSettings}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.ColumnDefinitions>\n                                <ColumnDefinition Width=\"32*\" />\n                                <ColumnDefinition Width=\"69*\" />\n                            </Grid.ColumnDefinitions>\n                            <Label Grid.Column=\"0\" Content=\"{DynamicResource Location}\"\n                                   VerticalContentAlignment=\"Center\" />\n                            <ComboBox x:Name=\"cbLocation\" Grid.Column=\"1\" Height=\"Auto\" SelectedIndex=\"0\" Margin=\"0,3\" />\n                        </Grid>\n                    </GroupBox>\n                    <GroupBox Grid.Row=\"1\" Header=\"{DynamicResource TimezoneSettings}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.ColumnDefinitions>\n                                <ColumnDefinition Width=\"32*\" />\n                                <ColumnDefinition Width=\"69*\" />\n                            </Grid.ColumnDefinitions>\n                            <Label Grid.Row=\"0\" Grid.Column=\"0\" Content=\"{DynamicResource Timezone}\"\n                                   VerticalContentAlignment=\"Center\" />\n                            <ComboBox Grid.Row=\"0\" Grid.Column=\"1\" Height=\"Auto\" x:Name=\"cbTimezone\" SelectedIndex=\"0\"\n                                      Margin=\"0,3\" />\n                        </Grid>\n                    </GroupBox>\n                    <GroupBox Grid.Row=\"2\" Header=\"{DynamicResource DebugOptions}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.RowDefinitions>\n                                <RowDefinition Height=\"1*\" />\n                                <RowDefinition Height=\"1*\" />\n                                <RowDefinition Height=\"1*\" />\n                                <RowDefinition Height=\"1*\" />\n                            </Grid.RowDefinitions>\n                            <CheckBox x:Name=\"cbStartAsAdmin\" Grid.Row=\"0\"\n                                      Content=\"{DynamicResource AsAdmin}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" />\n                            <CheckBox x:Name=\"cbRedirectRegistry\" Grid.Row=\"1\"\n                                      Content=\"{DynamicResource RedirectRegistry}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" IsChecked=\"True\" />\n                            <CheckBox x:Name=\"cbIsAdvancedRedirection\" Grid.Row=\"2\"\n                                      Content=\"{DynamicResource IsAdvancedRedirection}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" IsChecked=\"false\" />\n                            <CheckBox x:Name=\"cbStartAsSuspend\" Grid.Row=\"3\"\n                                      Content=\"{DynamicResource WithCREATESUSPENDED}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" />\n                        </Grid>\n                    </GroupBox>\n                </Grid>\n            </Grid>\n        </Grid>\n    </Grid>\n</Window>"
  },
  {
    "path": "LEGUI/AppConfig.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.InteropServices.ComTypes;\nusing System.Windows;\nusing LECommonLibrary;\n\nnamespace LEGUI\n{\n    /// <summary>\n    ///     Interaction logic for AppConfig.xaml\n    /// </summary>\n    public partial class AppConfig\n    {\n        private readonly List<CultureInfo> _cultureInfos = new List<CultureInfo>();\n        private readonly List<TimeZoneInfo> _timezones = new List<TimeZoneInfo>();\n\n        public AppConfig()\n        {\n            InitializeComponent();\n\n            Title += Path.GetFileName(App.StandaloneFilePath).Replace(\".le.config\", \"\");\n\n            // Region.\n            _cultureInfos = CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(i => i.DisplayName).ToList();\n            cbLocation.ItemsSource = _cultureInfos.Select(c => c.DisplayName);\n            cbLocation.SelectedIndex = _cultureInfos.FindIndex(c => c.Name == \"ja-JP\");\n\n            //Timezone.\n            _timezones = TimeZoneInfo.GetSystemTimeZones().ToList();\n            cbTimezone.ItemsSource = _timezones.Select(t => t.DisplayName);\n            cbTimezone.SelectedIndex = _timezones.FindIndex(tz => tz.Id == \"Tokyo Standard Time\");\n\n            // Load exists config.\n            var configs = LEConfig.GetProfiles(App.StandaloneFilePath);\n            if (configs.Length > 0)\n            {\n                var conf = configs[0];\n\n                if (!string.IsNullOrEmpty(conf.Parameter))\n                {\n                    tbAppParameter.FontStyle = FontStyles.Normal;\n                    tbAppParameter.Text = conf.Parameter;\n                }\n                cbTimezone.SelectedIndex = _timezones.FindIndex(tz => tz.Id == conf.Timezone);\n                cbLocation.SelectedIndex = _cultureInfos.FindIndex(ci => ci.Name == conf.Location);\n\n                cbStartAsAdmin.IsChecked = conf.RunAsAdmin;\n                cbRedirectRegistry.IsChecked = conf.RedirectRegistry;\n                cbIsAdvancedRedirection.IsChecked = conf.IsAdvancedRedirection;\n                cbStartAsSuspend.IsChecked = conf.RunWithSuspend;\n            }\n        }\n\n        private void SaveSetting()\n        {\n            var crt = new LEProfile(Path.GetFileName(App.StandaloneFilePath),\n                                    Guid.NewGuid().ToString(),\n                                    false,\n                                    tbAppParameter.Text,\n                                    _cultureInfos[cbLocation.SelectedIndex].Name,\n                                    _timezones[cbTimezone.SelectedIndex].Id,\n                                    cbStartAsAdmin.IsChecked != null && (bool)cbStartAsAdmin.IsChecked,\n                                    cbRedirectRegistry.IsChecked != null && (bool)cbRedirectRegistry.IsChecked,\n                                    cbIsAdvancedRedirection.IsChecked != null && (bool)cbIsAdvancedRedirection.IsChecked,\n                                    cbStartAsSuspend.IsChecked != null && (bool)cbStartAsSuspend.IsChecked\n                );\n\n            LEConfig.SaveApplicationConfigFile(App.StandaloneFilePath, crt);\n        }\n\n        private void CreateShortcut(string path)\n        {\n            try\n            {\n                var link = (IShellLink)new ShellLink();\n\n                link.SetPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                                          \"LEProc.exe\"));\n                link.SetArguments($\"-run \\\"{path}\\\"\");\n                link.SetIconLocation(AssociationReader.GetAssociatedIcon(Path.GetExtension(path)).Replace(\"%1\", path), 0);\n\n                link.SetDescription($\"Run {Path.GetFileName(path)} with Locale Emulator\");\n                link.SetWorkingDirectory(Path.GetDirectoryName(path));\n\n                var file = (IPersistFile)link;\n                file.Save(\n                          Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),\n                                       Path.GetFileNameWithoutExtension(path) + \".lnk\"),\n                          false);\n            }\n            catch (Exception e)\n            {\n                MessageBox.Show(e.Message + \"\\r\\n\\r\\n\" + e.StackTrace);\n            }\n        }\n\n        private void RunAndShutdown()\n        {\n            //Run the application.\n            Process.Start(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), \"LEProc.exe\"),\n                          $\"-run \\\"{App.StandaloneFilePath.Replace(\".le.config\", \"\")}\\\"\");\n\n            Application.Current.Shutdown();\n        }\n\n        private void bSaveAppSetting_Click(object sender, RoutedEventArgs e)\n        {\n            SaveSetting();\n\n            RunAndShutdown();\n        }\n\n        private void bShortcut_Click(object sender, RoutedEventArgs e)\n        {\n            SaveSetting();\n\n            CreateShortcut(App.StandaloneFilePath.Replace(\".le.config\", \"\"));\n\n            RunAndShutdown();\n        }\n\n        private void bDeleteAppSetting_Click(object sender, RoutedEventArgs e)\n        {\n            if (MessageBoxResult.No == MessageBox.Show(I18n.GetString(\"ConfirmDel\"), \"\", MessageBoxButton.YesNo))\n                return;\n\n            if (File.Exists(App.StandaloneFilePath))\n                File.Delete(App.StandaloneFilePath);\n\n            Application.Current.Shutdown();\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/GlobalConfig.xaml",
    "content": "﻿<Window x:Class=\"LEGUI.GlobalConfig\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        Title=\"LEGUI GLOBAL\" Height=\"377.16\" Width=\"310\"\n        WindowStartupLocation=\"CenterScreen\" ResizeMode=\"CanMinimize\">\n    <Grid TextElement.FontFamily=\"{DynamicResource UIFont}\">\n        <Grid x:Name=\"mainGrid\">\n            <Grid.RowDefinitions>\n                <RowDefinition Height=\"60\" />\n                <RowDefinition />\n            </Grid.RowDefinitions>\n            <Grid x:Name=\"globalConfigGrid\" Grid.Row=\"0\" Background=\"#FFF1F1F1\">\n                <Grid.RowDefinitions>\n                    <RowDefinition Height=\"1*\" />\n                    <RowDefinition Height=\"1*\" />\n                </Grid.RowDefinitions>\n                <Grid.ColumnDefinitions>\n                    <ColumnDefinition Width=\"1*\" />\n                    <ColumnDefinition Width=\"1*\" />\n                    <ColumnDefinition Width=\"1*\" />\n                </Grid.ColumnDefinitions>\n                <ComboBox SelectedIndex=\"0\" x:Name=\"cbGlobalProfiles\" Grid.Row=\"0\" Grid.Column=\"0\" Height=\"Auto\"\n                          Margin=\"3,3,3,4\"\n                          VerticalContentAlignment=\"Center\" Grid.ColumnSpan=\"3\"\n                          SelectionChanged=\"cbGlobalProfiles_SelectionChanged\" />\n                <Button x:Name=\"bSaveGlobalSetting\" Grid.Row=\"1\" Grid.Column=\"0\" Content=\"{DynamicResource Save}\"\n                        Margin=\"3,0,3,5\" Click=\"bSaveGlobalSetting_Click\" />\n                <Button x:Name=\"bSaveGlobalSettingAs\" Grid.Row=\"1\" Grid.Column=\"1\" Content=\"{DynamicResource SaveAs}\"\n                        Margin=\"3,0,3,5\" Click=\"bSaveGlobalSettingAs_Click\" />\n                <Button x:Name=\"bDeleteGlobalSetting\" Grid.Row=\"1\" Grid.Column=\"2\" Content=\"{DynamicResource Delete}\"\n                        Margin=\"3,0,3,5\" Click=\"bDeleteGlobalSetting_Click\" />\n            </Grid>\n            <Grid Grid.Row=\"1\" Margin=\"0,0,0,10\">\n                <Grid Grid.Column=\"0\">\n                    <Grid.RowDefinitions>\n                        <RowDefinition Height=\"1*\" />\n                        <RowDefinition Height=\"1*\" />\n                        <RowDefinition Height=\"2*\" />\n                        <RowDefinition Height=\"1*\" />\n                    </Grid.RowDefinitions>\n                    <GroupBox Grid.Row=\"0\" Header=\"{DynamicResource LocationSettings}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.ColumnDefinitions>\n                                <ColumnDefinition Width=\"101*\" />\n                                <ColumnDefinition Width=\"167*\" />\n                            </Grid.ColumnDefinitions>\n                            <Label Grid.Column=\"0\" Content=\"{DynamicResource Location}\"\n                                   VerticalContentAlignment=\"Center\" />\n                            <ComboBox x:Name=\"cbLocation\" Grid.Column=\"1\" Height=\"Auto\" SelectedIndex=\"0\" Margin=\"0,3\" />\n                        </Grid>\n                    </GroupBox>\n                    <GroupBox Grid.Row=\"1\" Header=\"{DynamicResource TimezoneSettings}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.ColumnDefinitions>\n                                <ColumnDefinition Width=\"101*\" />\n                                <ColumnDefinition Width=\"167*\" />\n                            </Grid.ColumnDefinitions>\n                            <Label Grid.Row=\"0\" Grid.Column=\"0\" Content=\"{DynamicResource Timezone}\"\n                                   VerticalContentAlignment=\"Center\" />\n                            <ComboBox Grid.Row=\"0\" Grid.Column=\"1\" Height=\"Auto\" x:Name=\"cbTimezone\" SelectedIndex=\"0\"\n                                      Margin=\"0,3\" />\n                        </Grid>\n                    </GroupBox>\n                    <GroupBox Grid.Row=\"2\" Header=\"{DynamicResource DebugOptions}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.RowDefinitions>\n                                <RowDefinition Height=\"1*\" />\n                                <RowDefinition Height=\"1*\" />\n                                <RowDefinition Height=\"1*\" />\n                                <RowDefinition Height=\"1*\" />\n                            </Grid.RowDefinitions>\n                            <CheckBox x:Name=\"cbStartAsAdmin\" Grid.Row=\"0\"\n                                      Content=\"{DynamicResource AsAdmin}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" />\n                            <CheckBox x:Name=\"cbRedirectRegistry\" Grid.Row=\"1\"\n                                      Content=\"{DynamicResource RedirectRegistry}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" IsChecked=\"True\" />\n                            <CheckBox x:Name=\"cbIsAdvancedRedirection\" Grid.Row=\"2\"\n                                      Content=\"{DynamicResource IsAdvancedRedirection}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" IsChecked=\"false\" />\n                            <CheckBox x:Name=\"cbStartAsSuspend\" Grid.Row=\"3\"\n                                      Content=\"{DynamicResource WithCREATESUSPENDED}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" />\n                        </Grid>\n                    </GroupBox>\n                    <GroupBox Grid.Row=\"3\" Header=\"{DynamicResource Miscellaneous}\" Margin=\"4,0\">\n                        <Grid>\n                            <Grid.RowDefinitions>\n                                <RowDefinition Height=\"*\" />\n                            </Grid.RowDefinitions>\n                            <CheckBox x:Name=\"cbShowInMainMenu\" Grid.Row=\"0\"\n                                      Content=\"{DynamicResource ShowInMainMenu}\" Margin=\"5,0,0,0\"\n                                      VerticalAlignment=\"Center\" />\n                        </Grid>\n                    </GroupBox>\n                </Grid>\n            </Grid>\n        </Grid>\n    </Grid>\n</Window>"
  },
  {
    "path": "LEGUI/GlobalConfig.xaml.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media.Effects;\nusing LECommonLibrary;\n\nnamespace LEGUI\n{\n    /// <summary>\n    ///     Interaction logic for GlobalConfig.xaml\n    /// </summary>\n    public partial class GlobalConfig\n    {\n        private readonly List<CultureInfo> _cultureInfos = new List<CultureInfo>();\n        private readonly List<LEProfile> _profiles = new List<LEProfile>();\n        private readonly List<TimeZoneInfo> _timezones = new List<TimeZoneInfo>();\n\n        public GlobalConfig()\n        {\n            InitializeComponent();\n\n            // Region.\n            _cultureInfos = CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(i => i.DisplayName).ToList();\n            cbLocation.ItemsSource = _cultureInfos.Select(c => c.DisplayName);\n\n            //Timezone.\n            _timezones = TimeZoneInfo.GetSystemTimeZones().ToList();\n            cbTimezone.ItemsSource = _timezones.Select(t => t.DisplayName);\n\n            //Profiles.\n            _profiles = LEConfig.GetProfiles().ToList();\n            cbGlobalProfiles.ItemsSource = _profiles.Select(p => p.Name);\n        }\n\n        private void bSaveGlobalSetting_Click(object sender, RoutedEventArgs e)\n        {\n            if (cbGlobalProfiles.Items.Count == 0)\n                return;\n\n            var crt = _profiles[cbGlobalProfiles.SelectedIndex];\n            crt.Location = _cultureInfos[cbLocation.SelectedIndex].Name;\n            crt.Timezone = _timezones[cbTimezone.SelectedIndex].Id;\n            crt.ShowInMainMenu = cbShowInMainMenu.IsChecked != null && (bool)cbShowInMainMenu.IsChecked;\n\n            crt.RunAsAdmin = cbStartAsAdmin.IsChecked != null && (bool)cbStartAsAdmin.IsChecked;\n            crt.RedirectRegistry = cbRedirectRegistry.IsChecked != null && (bool)cbRedirectRegistry.IsChecked;\n            crt.IsAdvancedRedirection = cbIsAdvancedRedirection.IsChecked != null\n                                        && (bool)cbIsAdvancedRedirection.IsChecked;\n            crt.RunWithSuspend = cbStartAsSuspend.IsChecked != null && (bool)cbStartAsSuspend.IsChecked;\n\n            _profiles[cbGlobalProfiles.SelectedIndex] = crt;\n\n            LEConfig.SaveGlobalConfigFile(_profiles.ToArray());\n        }\n\n        private void cbGlobalProfiles_SelectionChanged(object sender, SelectionChangedEventArgs e)\n        {\n            bDeleteGlobalSetting.IsEnabled = cbGlobalProfiles.Items.Count != 0;\n            bSaveGlobalSetting.IsEnabled = cbGlobalProfiles.Items.Count != 0;\n\n            if (cbGlobalProfiles.SelectedIndex == -1)\n            {\n                return;\n            }\n\n            var crt = _profiles[cbGlobalProfiles.SelectedIndex];\n\n            cbTimezone.SelectedIndex = _timezones.FindIndex(tz => tz.Id == crt.Timezone);\n            cbLocation.SelectedIndex = _cultureInfos.FindIndex(ci => ci.Name == crt.Location);\n\n            cbShowInMainMenu.IsChecked = crt.ShowInMainMenu;\n            cbStartAsAdmin.IsChecked = crt.RunAsAdmin;\n            cbRedirectRegistry.IsChecked = crt.RedirectRegistry;\n            cbIsAdvancedRedirection.IsChecked = crt.IsAdvancedRedirection;\n            cbStartAsSuspend.IsChecked = crt.RunWithSuspend;\n        }\n\n        private void bSaveGlobalSettingAs_Click(object sender, RoutedEventArgs e)\n        {\n            mainGrid.Effect = new BlurEffect();\n\n            var ib = new InputBox\n                     {\n                         Owner = this,\n                         WindowStartupLocation = WindowStartupLocation.CenterOwner,\n                         Instruction = I18n.GetString(\"SaveAsInstruction\"),\n                         OkText = I18n.GetString(\"Save\"),\n                         CancelText = I18n.GetString(\"Cancel\")\n                     };\n\n            if (ib.ShowDialog() == true && !string.IsNullOrEmpty(ib.Text))\n            {\n                SaveProfileAs(ib.Text);\n\n                cbGlobalProfiles.SelectedIndex = _profiles.Count - 1;\n            }\n\n            mainGrid.Effect = null;\n        }\n\n        private void SaveProfileAs(string name)\n        {\n            var pro = new LEProfile(name,\n                                    Guid.NewGuid().ToString(),\n                                    cbShowInMainMenu.IsChecked != null && (bool)cbShowInMainMenu.IsChecked,\n                                    string.Empty,\n                                    _cultureInfos[cbLocation.SelectedIndex].Name,\n                                    _timezones[cbTimezone.SelectedIndex].Id,\n                                    cbStartAsAdmin.IsChecked != null && (bool)cbStartAsAdmin.IsChecked,\n                                    cbRedirectRegistry.IsChecked != null && (bool)cbRedirectRegistry.IsChecked,\n                                    cbIsAdvancedRedirection.IsChecked != null && (bool)cbIsAdvancedRedirection.IsChecked,\n                                    cbStartAsSuspend.IsChecked != null && (bool)cbStartAsSuspend.IsChecked);\n\n            _profiles.Add(pro);\n\n            LEConfig.SaveGlobalConfigFile(_profiles.ToArray());\n\n            // Update cbGlobalProfiles.\n            cbGlobalProfiles.ItemsSource = _profiles.Select(p => p.Name);\n        }\n\n        private void bDeleteGlobalSetting_Click(object sender, RoutedEventArgs e)\n        {\n            if (cbGlobalProfiles.SelectedIndex == -1)\n                return;\n\n            if (MessageBoxResult.No == MessageBox.Show(I18n.GetString(\"ConfirmDel\"), \"\", MessageBoxButton.YesNo))\n                return;\n\n            _profiles.RemoveAt(cbGlobalProfiles.SelectedIndex);\n\n            LEConfig.SaveGlobalConfigFile(_profiles.ToArray());\n\n            // Update cbGlobalProfiles.\n            cbGlobalProfiles.ItemsSource = _profiles.Select(p => p.Name);\n            cbGlobalProfiles.SelectedIndex = 0;\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/I18n.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Reflection;\nusing System.Windows;\nusing System.Windows.Markup;\n\nnamespace LEGUI\n{\n    internal class I18n\n    {\n        internal static readonly CultureInfo CurrentCultureInfo = CultureInfo.CurrentUICulture;\n        //internal static readonly CultureInfo CurrentCultureInfo = CultureInfo.GetCultureInfo(\"zh-CN\");\n\n        private static ResourceDictionary cacheDictionary;\n\n        internal static string GetString(string key)\n        {\n            var dict = LoadDictionary();\n            try\n            {\n                var s = (string)dict[key];\n\n                if (string.IsNullOrEmpty(s))\n                    return key;\n\n                return s;\n            }\n            catch\n            {\n                return key;\n            }\n        }\n\n        private static ResourceDictionary LoadDictionary()\n        {\n            if (cacheDictionary != null)\n                return cacheDictionary;\n\n            ResourceDictionary dictionary = null;\n            try\n            {\n                var langDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @\"Lang\\\");\n\n                var firstLangPath = Path.Combine(langDir, CurrentCultureInfo.Name + \".xaml\");\n                var fallbackLangPath = Path.Combine(langDir,\n                                                    $@\"{CurrentCultureInfo.TwoLetterISOLanguageName}.xaml\");\n\n                if (File.Exists(firstLangPath))\n                    Application.Current.Resources.MergedDictionaries\n                               .Insert(0,\n                                       XamlReader.Load(new FileStream(firstLangPath, FileMode.Open))\n                                       as ResourceDictionary);\n                else\n                    Application.Current.Resources.MergedDictionaries\n                               .Insert(0,\n                                       XamlReader.Load(new FileStream(fallbackLangPath, FileMode.Open))\n                                       as ResourceDictionary);\n            }\n            catch\n            {\n            }\n\n            //If dictionary is still null, use default language.\n            if (dictionary == null)\n                if (Application.Current.Resources.MergedDictionaries.Count > 0)\n                    dictionary = Application.Current.Resources.MergedDictionaries[0];\n                else\n                    throw new Exception(\"No language file.\");\n\n            cacheDictionary = dictionary;\n\n            return cacheDictionary;\n        }\n\n        internal static void LoadLanguage()\n        {\n            var dict = LoadDictionary();\n\n            Application.Current.Resources.MergedDictionaries.Clear();\n            Application.Current.Resources.MergedDictionaries.Add(dict);\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/InputBox.xaml",
    "content": "﻿<Window x:Class=\"LEGUI.InputBox\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        mc:Ignorable=\"d\" ResizeMode=\"NoResize\" Height=\"174.018\" Width=\"280.219\" ShowInTaskbar=\"False\">\n    <Grid>\n        <Label x:Name=\"lText\" Margin=\"10,10,10,10\" Content=\"\" />\n        <TextBox x:Name=\"tbText\" Margin=\"10,46,9.6,77.2\" Height=\"Auto\" PreviewKeyDown=\"tbText_PreviewKeyDown\" />\n        <Button x:Name=\"bOk\" Content=\"OK\" Margin=\"68,98,140.6,21.2\" Click=\"bOk_Click\" />\n        <Button x:Name=\"bCancel\" Content=\"Cancel\" Margin=\"138,98,71.6,21.2\" Click=\"bCancel_Click\" />\n    </Grid>\n</Window>"
  },
  {
    "path": "LEGUI/InputBox.xaml.cs",
    "content": "﻿using System.Windows;\nusing System.Windows.Input;\n\nnamespace LEGUI\n{\n    /// <summary>\n    ///     Interaction logic for InputBox.xaml\n    /// </summary>\n    public partial class InputBox : Window\n    {\n        public InputBox()\n        {\n            InitializeComponent();\n\n            tbText.Focus();\n        }\n\n        public string Instruction\n        {\n            get { return lText.Content.ToString(); }\n            set { lText.Content = value; }\n        }\n\n        public string Text\n        {\n            get { return tbText.Text; }\n            set { tbText.Text = value; }\n        }\n\n        public string OkText\n        {\n            get { return bOk.Content.ToString(); }\n            set { bOk.Content = value; }\n        }\n\n        public string CancelText\n        {\n            get { return bCancel.Content.ToString(); }\n            set { bCancel.Content = value; }\n        }\n\n        private void bOk_Click(object sender, RoutedEventArgs e)\n        {\n            DialogResult = true;\n        }\n\n        private void bCancel_Click(object sender, RoutedEventArgs e)\n        {\n            DialogResult = false;\n        }\n\n        private void tbText_PreviewKeyDown(object sender, KeyEventArgs e)\n        {\n            if (e.Key == Key.Enter)\n            {\n                e.Handled = true;\n                DialogResult = true;\n            }\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/LEGUI.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>LEGUI</RootNamespace>\n    <AssemblyName>LEGUI</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\Build\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\Build\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>icon.ico</ApplicationIcon>\n  </PropertyGroup>\n  <PropertyGroup />\n  <PropertyGroup>\n    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ApplicationDefinition Include=\"App.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </ApplicationDefinition>\n    <Compile Include=\"AppConfig.xaml.cs\">\n      <DependentUpon>AppConfig.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ShellLink.cs\" />\n    <Page Include=\"InputBox.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Lang\\DefaultLanguage.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"AppConfig.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"MaskedTextBox.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Resource Include=\"icon.ico\" />\n    <Page Include=\"GlobalConfig.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Compile Include=\"App.xaml.cs\">\n      <DependentUpon>App.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"I18n.cs\" />\n    <Compile Include=\"GlobalConfig.xaml.cs\">\n      <DependentUpon>GlobalConfig.xaml</DependentUpon>\n      <SubType>Code</SubType>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"InputBox.xaml.cs\">\n      <DependentUpon>InputBox.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"MaskedTextBox.xaml.cs\">\n      <DependentUpon>MaskedTextBox.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"key.snk\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\LECommonLibrary\\LECommonLibrary.csproj\">\n      <Project>{c4def32b-8fbb-41b6-80dc-c60339402323}</Project>\n      <Name>LECommonLibrary</Name>\n      <EmbedInteropTypes>False</EmbedInteropTypes>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5.1\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5.1 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <PropertyGroup>\n    <PostBuildEvent>mkdir \"$(TargetDir)Lang\\\"\ncopy /Y \"$(ProjectDir)Lang\\*.xaml\" \"$(TargetDir)Lang\\\"\n</PostBuildEvent>\n  </PropertyGroup>\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "LEGUI/Lang/DefaultLanguage.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Enter argument here (if any)</system:String>\n    <system:String x:Key=\"Save\">Save</system:String>\n    <system:String x:Key=\"Shortcut\">Create shortcut</system:String>\n    <system:String x:Key=\"Cancel\">Cancel</system:String>\n    <system:String x:Key=\"SaveAs\">Save As ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">New profile name:</system:String>\n    <system:String x:Key=\"Delete\">Delete</system:String>\n    <system:String x:Key=\"ConfirmDel\">Are you sure you want to delete this profile?</system:String>\n    <system:String x:Key=\"Location\">Location</system:String>\n    <system:String x:Key=\"LocationSettings\">Location Settings</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Timezone Settings</system:String>\n    <system:String x:Key=\"Timezone\">Timezone</system:String>\n    <system:String x:Key=\"DebugOptions\">Advanced Options</system:String>\n    <system:String x:Key=\"AsAdmin\">Run as administrator</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Fake language-related keys in Registry</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Fake system UI language</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Create process with CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Miscellaneous</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Show this profile in main menu</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/ca.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Escriure arguments aquí (si n'hi ha)</system:String>\n    <system:String x:Key=\"Save\">Desar</system:String>\n    <system:String x:Key=\"Shortcut\">Crear accés directe</system:String>\n    <system:String x:Key=\"Cancel\">Cancel·lar</system:String>\n    <system:String x:Key=\"SaveAs\">Desar com...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Nom del nou perfil:</system:String>\n    <system:String x:Key=\"Delete\">Esborrar</system:String>\n    <system:String x:Key=\"ConfirmDel\">Segur que vol eliminar aquest perfil?</system:String>\n    <system:String x:Key=\"Location\">Ubicació</system:String>\n    <system:String x:Key=\"LocationSettings\">Configuració de la Ubicació</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Configuració de la Zona Horària</system:String>\n    <system:String x:Key=\"Timezone\">Zona Horària</system:String>\n    <system:String x:Key=\"DebugOptions\">Opcions Avançades</system:String>\n    <system:String x:Key=\"AsAdmin\">Executar com a administrador</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Falsificar registre</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Falsificar llenguatge del sistema</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Crear procés amb CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Divers</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Mostrar aquest perfil al menú principal</system:String>\n</ResourceDictionary>"
  },
  {
    "path": "LEGUI/Lang/cs.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Zde vložte parametry (pokud jsou)</system:String>\n    <system:String x:Key=\"Save\">Uložit</system:String>\n    <system:String x:Key=\"Shortcut\">Vytvořit zástupce</system:String>\n    <system:String x:Key=\"Cancel\">Zrušit</system:String>\n    <system:String x:Key=\"SaveAs\">Uložit jako...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Jméno nového profilu:</system:String>\n    <system:String x:Key=\"Delete\">Smazat</system:String>\n    <system:String x:Key=\"ConfirmDel\">Opravdu chcete smazat tento profil?</system:String>\n    <system:String x:Key=\"Location\">Poloha</system:String>\n    <system:String x:Key=\"LocationSettings\">Nastavení polohy</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Nastavení časové zóny</system:String>\n    <system:String x:Key=\"Timezone\">Časová zóna</system:String>\n    <system:String x:Key=\"DebugOptions\">Pokročilé nastavení</system:String>\n    <system:String x:Key=\"AsAdmin\">Spustit jako administrator</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Zfalšovat v registru klíče týkající se jazyka</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Zfalšovat jazyk uživatelského rozhraní</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Vytvořit proces s CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Ostatní</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Zobrazit tento profil v hlavním menu</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/de.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Parameter (falls benötigt)</system:String>\n    <system:String x:Key=\"Save\">Speichern</system:String>\n    <system:String x:Key=\"Shortcut\">Verknüpfung anlegen</system:String>\n    <system:String x:Key=\"Cancel\">Abbrechen</system:String>\n    <system:String x:Key=\"SaveAs\">Speichern unter...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Neuer Profilname:</system:String>\n    <system:String x:Key=\"Delete\">Löschen</system:String>\n    <system:String x:Key=\"ConfirmDel\">Möchten Sie dieses Profil wirklich löschen?</system:String>\n    <system:String x:Key=\"Location\">Sprachumgebung</system:String>\n    <system:String x:Key=\"LocationSettings\">Sprachumgebung</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Zeitzone</system:String>\n    <system:String x:Key=\"Timezone\">Zeitzone</system:String>\n    <system:String x:Key=\"DebugOptions\">Erweitert</system:String>\n    <system:String x:Key=\"AsAdmin\">Als Administrator ausführen</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Registrierungseinträge vortäuschen</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">System-UI Sprache vortäuschen</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Prozess mit CREATE__SUSPENDED aufrufen</system:String>\n    <system:String x:Key=\"Miscellaneous\">Sonstiges</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Profil im Kontextmenü anzeigen</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/es.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Insertar argumentos aquí (si existen)</system:String>\n    <system:String x:Key=\"Save\">Guardar</system:String>\n    <system:String x:Key=\"Shortcut\">Crear acceso directo</system:String>\n    <system:String x:Key=\"Cancel\">Cancelar</system:String>\n    <system:String x:Key=\"SaveAs\">Guardar como...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Nombre del nuevo perfil:</system:String>\n    <system:String x:Key=\"Delete\">Eliminar</system:String>\n    <system:String x:Key=\"ConfirmDel\">¿Está seguro de que quiere eliminar este perfil?</system:String>\n    <system:String x:Key=\"Location\">Ubicación</system:String>\n    <system:String x:Key=\"LocationSettings\">Ajustes de Ubicación</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Ajustes de Zona Horaria</system:String>\n    <system:String x:Key=\"Timezone\">Zona Horaria</system:String>\n    <system:String x:Key=\"DebugOptions\">Opciones Avanzadas</system:String>\n    <system:String x:Key=\"AsAdmin\">Ejecutar como administrador</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Falsificar registro</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Falsificar idioma de la UI del sistema</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Crear proceso con CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Miscelánea</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Mostrar este perfil en el menú principal</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/fr.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Saisissez un ou des arguments ici (facultatif)</system:String>\n    <system:String x:Key=\"Save\">Enregistrer</system:String>\n    <system:String x:Key=\"Shortcut\">Créer un raccourci</system:String>\n    <system:String x:Key=\"Cancel\">Annuler</system:String>\n    <system:String x:Key=\"SaveAs\">Enregistrer sous...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Nom du nouveau profil :</system:String>\n    <system:String x:Key=\"Delete\">Supprimer</system:String>\n    <system:String x:Key=\"ConfirmDel\">Voulez-vous vraiment supprimer ce profil ?</system:String>\n    <system:String x:Key=\"Location\">Localisation</system:String>\n    <system:String x:Key=\"LocationSettings\">Paramètres de localisation</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Paramètres du fuseau horaire</system:String>\n    <system:String x:Key=\"Timezone\">Fuseau horaire</system:String>\n    <system:String x:Key=\"DebugOptions\">Options avancées</system:String>\n    <system:String x:Key=\"AsAdmin\">Exécuter en tant qu'administrateur</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Utiliser un faux registre</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Utiliser une fausse langue système</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Créer processus avec CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Divers</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Afficher ce profil dans le menu principal</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/ind.xaml",
    "content": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Masukkan argumen di sini (jika ada)</system:String>\n    <system:String x:Key=\"Save\">Simpan</system:String>\n    <system:String x:Key=\"Shortcut\">Buat shortcut</system:String>\n    <system:String x:Key=\"Cancel\">Batal</system:String>\n    <system:String x:Key=\"SaveAs\">Simpan sebagai ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Nama profil baru:</system:String>\n    <system:String x:Key=\"Delete\">Hapus</system:String>\n    <system:String x:Key=\"ConfirmDel\">Anda yakin ingin menghapus profil ini?</system:String>\n    <system:String x:Key=\"Location\">Lokasi</system:String>\n    <system:String x:Key=\"LocationSettings\">Pengaturan Lokasi</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Pengaturan Zona waktu</system:String>\n    <system:String x:Key=\"Timezone\">Zona waktu</system:String>\n    <system:String x:Key=\"DebugOptions\">Opsi tingkat lanjut</system:String>\n    <system:String x:Key=\"AsAdmin\">Jalankan sebagai administrator</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Palsukan bahasa di Registry</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Palsukan Bahasa UI sistem</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Buat proses dengan CREATE_SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Lain-Lain</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Tampilkan profil ini di menu utama</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/it.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Inserire l'argomento qui (se esistente)</system:String>\n    <system:String x:Key=\"Save\">Salva</system:String>\n    <system:String x:Key=\"Shortcut\">Crea collegamento</system:String>\n    <system:String x:Key=\"Cancel\">Annulla</system:String>\n    <system:String x:Key=\"SaveAs\">Salva Come ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Nome nuovo profilo:</system:String>\n    <system:String x:Key=\"Delete\">Elimina</system:String>\n    <system:String x:Key=\"ConfirmDel\">Sei sicuro di voler eliminare questo profilo?</system:String>\n    <system:String x:Key=\"Location\">Posizione</system:String>\n    <system:String x:Key=\"LocationSettings\">Impostazioni Posizione</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Impostazioni Fuso Orario</system:String>\n    <system:String x:Key=\"Timezone\">Fuso Orario</system:String>\n    <system:String x:Key=\"DebugOptions\">Opzioni Avanzate</system:String>\n    <system:String x:Key=\"AsAdmin\">Esegui come amministratore</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Registro di falso</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Lingua dell'interfaccia utente falso</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Crea processo con CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Varie</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Mostra profilo nel menù principale</system:String>\n</ResourceDictionary>"
  },
  {
    "path": "LEGUI/Lang/ja.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Meiryo UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">コマンドを入力</system:String>\n    <system:String x:Key=\"Save\">保存</system:String>\n    <system:String x:Key=\"Shortcut\">ショットカット</system:String>\n    <system:String x:Key=\"Cancel\">キャンセル</system:String>\n    <system:String x:Key=\"SaveAs\">名前を付けて保存</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">新しいプロファイルの名前を設定</system:String>\n    <system:String x:Key=\"Delete\">削除</system:String>\n    <system:String x:Key=\"ConfirmDel\">プロファイルを削除しますか？</system:String>\n    <system:String x:Key=\"Location\">場所</system:String>\n    <system:String x:Key=\"LocationSettings\">場所設定</system:String>\n    <system:String x:Key=\"TimezoneSettings\">タイムゾーンを設定</system:String>\n    <system:String x:Key=\"Timezone\">タイムゾーン</system:String>\n    <system:String x:Key=\"DebugOptions\">上級者用オプション</system:String>\n    <system:String x:Key=\"AsAdmin\">管理者として実行</system:String>\n    <system:String x:Key=\"RedirectRegistry\">言語関連のレジストリキーを偽造</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">システムのUI言語を偽造</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">CREATE__SUSPENDEDでプロセスを実行</system:String>\n    <system:String x:Key=\"Miscellaneous\">その他</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">メインメニュでプロファイルを表示</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/ka.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">შეიყვანეთ არგუმენტები (არსებობის შემთხვევაში)</system:String>\n    <system:String x:Key=\"Save\">შენახვა</system:String>\n    <system:String x:Key=\"Shortcut\">მალსახმობის შექმნა</system:String>\n    <system:String x:Key=\"Cancel\">გაუქმება</system:String>\n    <system:String x:Key=\"SaveAs\">შენახვა როგორც...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">ახალი პროფილის სახელი:</system:String>\n    <system:String x:Key=\"Delete\">წაშლა</system:String>\n    <system:String x:Key=\"ConfirmDel\">დარწმუნებული ხართ რომ გინდათ ამ პროფილის წაშლა?</system:String>\n    <system:String x:Key=\"Location\">ადგილმდებარეობა</system:String>\n    <system:String x:Key=\"LocationSettings\">ადგილმდებარეობის პარამეტრები</system:String>\n    <system:String x:Key=\"TimezoneSettings\">დროის სარტყელის პარამეტრები</system:String>\n    <system:String x:Key=\"Timezone\">დროის სარტყელი</system:String>\n    <system:String x:Key=\"DebugOptions\">დამატებითი პარამეტრები</system:String>\n    <system:String x:Key=\"AsAdmin\">ადმინისტრატორით გაშვება</system:String>\n    <system:String x:Key=\"RedirectRegistry\">ენის ემულაცია რეგისტრში</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">ენის ემულაცია სისტემურ UI-ში</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">პროცესის შექმნა პარამეტრით CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">სხვადასხვა</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">ამ პროფილის მტავარ მენიუში ჩვენება</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/ko.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">명령 입력</system:String>\n    <system:String x:Key=\"Save\">저장</system:String>\n    <system:String x:Key=\"Shortcut\">바로가기 생성</system:String>\n    <system:String x:Key=\"Cancel\">취소</system:String>\n    <system:String x:Key=\"SaveAs\">새 프로필로 저장</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">새 프로필 이름:</system:String>\n    <system:String x:Key=\"Delete\">삭제</system:String>\n    <system:String x:Key=\"ConfirmDel\">이 프로필을 정말로 삭제 하시겠습니까?</system:String>\n    <system:String x:Key=\"Location\">위치</system:String>\n    <system:String x:Key=\"LocationSettings\">위치 설정</system:String>\n    <system:String x:Key=\"TimezoneSettings\">시간대 설정</system:String>\n    <system:String x:Key=\"Timezone\">시간대</system:String>\n    <system:String x:Key=\"DebugOptions\">고급사용자 옵션</system:String>\n    <system:String x:Key=\"AsAdmin\">관리자 권한으로 실행</system:String>\n    <system:String x:Key=\"RedirectRegistry\">레지스트리 위조</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">시스템 UI 언어 위조</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">CREATE__SUSPENDED로 프로세스를 실행</system:String>\n    <system:String x:Key=\"Miscellaneous\">기타</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">메인 메뉴에 이 프로필을 보이기</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/lt.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Čia įveskite programos argumentus (jei reikia)</system:String>\n    <system:String x:Key=\"Save\">Įrašyti</system:String>\n    <system:String x:Key=\"Shortcut\">Kurti nuorodą</system:String>\n    <system:String x:Key=\"Cancel\">Atšaukti</system:String>\n    <system:String x:Key=\"SaveAs\">Įrašyti kaip…</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Naujojo profilio pavadinimas:</system:String>\n    <system:String x:Key=\"Delete\">Naikinti</system:String>\n    <system:String x:Key=\"ConfirmDel\">Ar tikrai norite naikinti šį profilį?</system:String>\n    <system:String x:Key=\"Location\">Lokalė</system:String>\n    <system:String x:Key=\"LocationSettings\">Lokalės parinktys</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Laiko juostos parinktys</system:String>\n    <system:String x:Key=\"Timezone\">Laiko juosta</system:String>\n    <system:String x:Key=\"DebugOptions\">Sudėtingesnės parinktys</system:String>\n    <system:String x:Key=\"AsAdmin\">Vykdyti administratoriaus teisėmis</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Netikras registras</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Netikra sistemos rodymo kalba</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Kurti procesą su CREATE__SUSPENDED gaire</system:String>\n    <system:String x:Key=\"Miscellaneous\">Kita</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Rodyti šį profilį pagrindiniame meniu</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/nb.xaml",
    "content": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Skriv inn argumenter her (Valgfritt)</system:String>\n    <system:String x:Key=\"Save\">Lagre</system:String>\n    <system:String x:Key=\"Shortcut\">Lag en snarvei</system:String>\n    <system:String x:Key=\"Cancel\">Lukk</system:String>\n    <system:String x:Key=\"SaveAs\">Lagre som ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Navnet til den nye profilen:</system:String>\n    <system:String x:Key=\"Delete\">Slett</system:String>\n    <system:String x:Key=\"ConfirmDel\">Er du sikker på at du vil slette denne profilen?</system:String>\n    <system:String x:Key=\"Location\">Posisjon</system:String>\n    <system:String x:Key=\"LocationSettings\">Posisjonsinnstillinger</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Tidssoneinnstillinger</system:String>\n    <system:String x:Key=\"Timezone\">Tidssone</system:String>\n    <system:String x:Key=\"DebugOptions\">Avanserte innstillinger</system:String>\n    <system:String x:Key=\"AsAdmin\">Kjør som administrator</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Imiter et systemregister</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Imiter et systemgrensesnittsspråk</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Lag en prosess med CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Diverse</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Vis denne profilen i hovedmenyen</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/nl.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\r\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\r\n    <system:String x:Key=\"EnterArgument\">Hier argument invoeren (indien aanwezig)</system:String>\r\n    <system:String x:Key=\"Save\">Opslaan</system:String>\r\n    <system:String x:Key=\"Shortcut\">Sneltoets maken</system:String>\r\n    <system:String x:Key=\"Cancel\">Annuleren</system:String>\r\n    <system:String x:Key=\"SaveAs\">Opslaan als ...</system:String>\r\n    <system:String x:Key=\"SaveAsInstruction\">Nieuwe profielnaam:</system:String>\r\n    <system:String x:Key=\"Delete\">Verwijderen</system:String>\r\n    <system:String x:Key=\"ConfirmDel\">Weet u zeker dat u dit profiel wilt verwijderen?</system:String>\r\n    <system:String x:Key=\"Location\">Locatie</system:String>\r\n    <system:String x:Key=\"LocationSettings\">Locatie instellingen</system:String>\r\n    <system:String x:Key=\"TimezoneSettings\">Tijdzone instellingen</system:String>\r\n    <system:String x:Key=\"Timezone\">Tijdzone</system:String>\r\n    <system:String x:Key=\"DebugOptions\">Geavanceerde opties</system:String>\r\n    <system:String x:Key=\"AsAdmin\">Uitvoeren als beheerder</system:String>\r\n    <system:String x:Key=\"RedirectRegistry\">Nep-register</system:String>\r\n    <system:String x:Key=\"IsAdvancedRedirection\">Nep-systeem interface taal</system:String>\r\n    <system:String x:Key=\"WithCREATESUSPENDED\">Proces maken met CREATE__SUSPENDED</system:String>\r\n    <system:String x:Key=\"Miscellaneous\">Diversen</system:String>\r\n    <system:String x:Key=\"ShowInMainMenu\">Dit profiel weergeven in het hoofdmenu</system:String>\r\n</ResourceDictionary>"
  },
  {
    "path": "LEGUI/Lang/pl.xaml",
    "content": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Wpisz argumenty tutaj (jeśli są)</system:String>\n    <system:String x:Key=\"Save\">Zapisz</system:String>\n    <system:String x:Key=\"Shortcut\">Utwórz skrót</system:String>\n    <system:String x:Key=\"Cancel\">Anuluj</system:String>\n    <system:String x:Key=\"SaveAs\">Zapisz jako ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Nazwa nowego profilu:</system:String>\n    <system:String x:Key=\"Delete\">Usuń</system:String>\n    <system:String x:Key=\"ConfirmDel\">Jesteś pewien że chcesz usunąć ten profil?</system:String>\n    <system:String x:Key=\"Location\">Lokalizacja</system:String>\n    <system:String x:Key=\"LocationSettings\">Ustawienia lokalizacji</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Ustawienia strefy czasowej</system:String>\n    <system:String x:Key=\"Timezone\">Strefa czasowa</system:String>\n    <system:String x:Key=\"DebugOptions\">Ustawienia zaawansowane</system:String>\n    <system:String x:Key=\"AsAdmin\">Uruchom jako administrator</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Symuluj ustawienia języka w rejestrze</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Symuluj język Interfejsu Użytkownika systemu</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Utwórz proces z CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Różne</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Wyświetlaj ten profil w menu kontekstowym</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/pt-BR.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Insira o argumento aqui (se houver)</system:String>\n    <system:String x:Key=\"Save\">Salvar</system:String>\n    <system:String x:Key=\"Shortcut\">Criar atalho</system:String>\n    <system:String x:Key=\"Cancel\">Cancelar</system:String>\n    <system:String x:Key=\"SaveAs\">Salvar como ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Novo nome de perfil:</system:String>\n    <system:String x:Key=\"Delete\">Excluir</system:String>\n    <system:String x:Key=\"ConfirmDel\">Tem certeza que quer excluir este perfil?</system:String>\n    <system:String x:Key=\"Location\">Localização</system:String>\n    <system:String x:Key=\"LocationSettings\">Definições de localização</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Definições de fuso horário</system:String>\n    <system:String x:Key=\"Timezone\">Fuso horário</system:String>\n    <system:String x:Key=\"DebugOptions\">Advanced Options</system:String>\n    <system:String x:Key=\"AsAdmin\">Executar como administrador</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Registro falso</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Interface em falso</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Criar processo com CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Miscelânea</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Exibir este perfil no menu principal</system:String>\n</ResourceDictionary>"
  },
  {
    "path": "LEGUI/Lang/ru.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Параметры командной строки для запуска приложения (если есть)</system:String>\n    <system:String x:Key=\"Save\">Сохранить</system:String>\n    <system:String x:Key=\"Shortcut\">Создать ярлык</system:String>\n    <system:String x:Key=\"Cancel\">Отмена</system:String>\n    <system:String x:Key=\"SaveAs\">Сохранить как ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Имя нового профиля:</system:String>\n    <system:String x:Key=\"Delete\">Удалить</system:String>\n    <system:String x:Key=\"ConfirmDel\">Уверены, что хотите удалить этот профиль?</system:String>\n    <system:String x:Key=\"Location\">Местоположение</system:String>\n    <system:String x:Key=\"LocationSettings\">Настройки местоположения</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Настройки часового пояса</system:String>\n    <system:String x:Key=\"Timezone\">Часовой пояс</system:String>\n    <system:String x:Key=\"DebugOptions\">Дополнительные настройки</system:String>\n    <system:String x:Key=\"AsAdmin\">Запуск от имени администратора</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Подменять реестр</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Подменять язык интерфейса системы</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">Создать процесс с параметром CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">Разное</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Показать этот профиль в главном меню</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/th.xaml",
    "content": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Leelawadee UI Regular</FontFamily>\n    <system:String x:Key=\"EnterArgument\">ใส่อาร์กิวเมนต์ (ถ้ามี)</system:String>\n    <system:String x:Key=\"Save\">บันทึก</system:String>\n    <system:String x:Key=\"Shortcut\">ถ้ามี</system:String>\n    <system:String x:Key=\"Cancel\">ยกเลิก</system:String>\n    <system:String x:Key=\"SaveAs\">บันทึกเป็น ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">ชื่อโปรไฟล์ใหม่:</system:String>\n    <system:String x:Key=\"Delete\">ลบ</system:String>\n    <system:String x:Key=\"ConfirmDel\">คุณต้องการที่จะลบโปรไฟล์นี่หรือไม่?</system:String>\n    <system:String x:Key=\"Location\">สถานที่</system:String>\n    <system:String x:Key=\"LocationSettings\">ตั้งค่าสถานที่</system:String>\n    <system:String x:Key=\"TimezoneSettings\">ตั้งค่าเขตเวลา</system:String>\n    <system:String x:Key=\"Timezone\">เขตเวลา</system:String>\n    <system:String x:Key=\"DebugOptions\">ตั้งค่าขั้นสูง</system:String>\n    <system:String x:Key=\"AsAdmin\">เปิดเป็นผู้ดูแลระบบ</system:String>\n    <system:String x:Key=\"RedirectRegistry\">รีจิสทรีหลอก</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">ภาษาอินเตอร์เฟสหลอก</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">สร้างโปรเซสด้วย CREATE__SUSPENDED</system:String>\n    <system:String x:Key=\"Miscellaneous\">เบ็ดเตล็ด</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">แสดงโปรไฟล์นี้ในเมนูหลัก</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/tr-TR.xaml",
    "content": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">Segoe UI</FontFamily>\n    <system:String x:Key=\"EnterArgument\">Argümanı buraya gir (eğer varsa)</system:String>\n    <system:String x:Key=\"Save\">Kaydet</system:String>\n    <system:String x:Key=\"Shortcut\">Kısayol ekle</system:String>\n    <system:String x:Key=\"Cancel\">İptal</system:String>\n    <system:String x:Key=\"SaveAs\">Farklı Kaydet ...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">Yeni profil ismi:</system:String>\n    <system:String x:Key=\"Delete\">Sil</system:String>\n    <system:String x:Key=\"ConfirmDel\">Bu profili silmek istediğinize emin misiniz?</system:String>\n    <system:String x:Key=\"Location\">Konum</system:String>\n    <system:String x:Key=\"LocationSettings\">Konum Ayarları</system:String>\n    <system:String x:Key=\"TimezoneSettings\">Saat Dilimi Ayarları</system:String>\n    <system:String x:Key=\"Timezone\">Saat dilimi</system:String>\n    <system:String x:Key=\"DebugOptions\">Gelişmiş Ayarlar</system:String>\n    <system:String x:Key=\"AsAdmin\">Yönetici olarak çalıştır</system:String>\n    <system:String x:Key=\"RedirectRegistry\">Kayıt Defterinde dil bağlantılı sahte anahtarlar</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">Sahte sistem arayüz dili</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">İşlemi CREATE__SUSPENDED ile yarat</system:String>\n    <system:String x:Key=\"Miscellaneous\">Çeşitli</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">Bu profili ana menüde göster</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/zh-CN.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">微软雅黑</FontFamily>\n    <system:String x:Key=\"EnterArgument\">在此输入运行参数</system:String>\n    <system:String x:Key=\"Save\">保存</system:String>\n    <system:String x:Key=\"Shortcut\">建立快捷方式</system:String>\n    <system:String x:Key=\"Cancel\">取消</system:String>\n    <system:String x:Key=\"SaveAs\">保存为...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">配置名：</system:String>\n    <system:String x:Key=\"Delete\">删除</system:String>\n    <system:String x:Key=\"ConfirmDel\">确认删除此配置么？</system:String>\n    <system:String x:Key=\"Location\">预置配置</system:String>\n    <system:String x:Key=\"LocationSettings\">位置设定</system:String>\n    <system:String x:Key=\"TimezoneSettings\">时区设置</system:String>\n    <system:String x:Key=\"Timezone\">时区</system:String>\n    <system:String x:Key=\"DebugOptions\">高级选项</system:String>\n    <system:String x:Key=\"AsAdmin\">以管理员权限运行</system:String>\n    <system:String x:Key=\"RedirectRegistry\">伪造语言相关注册表键值</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">伪造系统 UI 语言</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">用 CREATE__SUSPENDED 标志创建进程</system:String>\n    <system:String x:Key=\"Miscellaneous\">其它</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">在一级菜单中显示此配置</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/zh-HK.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\n    <FontFamily x:Key=\"UIFont\">微軟正黑體</FontFamily>\n    <system:String x:Key=\"EnterArgument\">在此輸入執行參數</system:String>\n    <system:String x:Key=\"Save\">儲存</system:String>\n    <system:String x:Key=\"Shortcut\">在桌面放置捷徑</system:String>\n    <system:String x:Key=\"Cancel\">取消</system:String>\n    <system:String x:Key=\"SaveAs\">另存為...</system:String>\n    <system:String x:Key=\"SaveAsInstruction\">設定名稱：</system:String>\n    <system:String x:Key=\"Delete\">刪除</system:String>\n    <system:String x:Key=\"ConfirmDel\">確定刪除此設定嗎？</system:String>\n    <system:String x:Key=\"Location\">位置</system:String>\n    <system:String x:Key=\"LocationSettings\">位置設定</system:String>\n    <system:String x:Key=\"TimezoneSettings\">時區設定</system:String>\n    <system:String x:Key=\"Timezone\">時區</system:String>\n    <system:String x:Key=\"DebugOptions\">進階選項</system:String>\n    <system:String x:Key=\"AsAdmin\">以管理員身分執行</system:String>\n    <system:String x:Key=\"RedirectRegistry\">偽造語言註冊表中語言相關選項</system:String>\n    <system:String x:Key=\"IsAdvancedRedirection\">偽造系統 UI 語言</system:String>\n    <system:String x:Key=\"WithCREATESUSPENDED\">用 CREATE__SUSPENDED 標誌建立進程</system:String>\n    <system:String x:Key=\"Miscellaneous\">其它</system:String>\n    <system:String x:Key=\"ShowInMainMenu\">在主選單中顯示此設定</system:String>\n</ResourceDictionary>\n"
  },
  {
    "path": "LEGUI/Lang/zh-TW.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\r\n    <FontFamily x:Key=\"UIFont\">微軟正黑體</FontFamily>\r\n    <system:String x:Key=\"EnterArgument\">在此輸入執行參數</system:String>\r\n    <system:String x:Key=\"Save\">儲存</system:String>\r\n    <system:String x:Key=\"Shortcut\">在桌面放置捷徑</system:String>\r\n    <system:String x:Key=\"Cancel\">取消</system:String>\r\n    <system:String x:Key=\"SaveAs\">另存為...</system:String>\r\n    <system:String x:Key=\"SaveAsInstruction\">設定檔名稱：</system:String>\r\n    <system:String x:Key=\"Delete\">刪除</system:String>\r\n    <system:String x:Key=\"ConfirmDel\">確定刪除此設定嗎？</system:String>\r\n    <system:String x:Key=\"Location\">位置</system:String>\r\n    <system:String x:Key=\"LocationSettings\">位置設定</system:String>\r\n    <system:String x:Key=\"TimezoneSettings\">時區設定</system:String>\r\n    <system:String x:Key=\"Timezone\">時區</system:String>\r\n    <system:String x:Key=\"DebugOptions\">進階選項</system:String>\r\n    <system:String x:Key=\"AsAdmin\">以管理員身分執行</system:String>\r\n    <system:String x:Key=\"RedirectRegistry\">偽造登錄檔中語言相關選項</system:String>\r\n    <system:String x:Key=\"IsAdvancedRedirection\">偽造系統 UI 語言</system:String>\r\n    <system:String x:Key=\"WithCREATESUSPENDED\">用 CREATE__SUSPENDED 標誌建立處理程序</system:String>\r\n    <system:String x:Key=\"Miscellaneous\">其他</system:String>\r\n    <system:String x:Key=\"ShowInMainMenu\">在主選單中顯示此設定</system:String>\r\n</ResourceDictionary>\r\n"
  },
  {
    "path": "LEGUI/MaskedTextBox.xaml",
    "content": "﻿<TextBox x:Class=\"LEGUI.MaskedTextBox\"\n         xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n         xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n         xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n         xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n         mc:Ignorable=\"d\"\n         d:DesignHeight=\"300\" d:DesignWidth=\"300\">\n</TextBox>"
  },
  {
    "path": "LEGUI/MaskedTextBox.xaml.cs",
    "content": "﻿using System.Windows;\nusing System.Windows.Controls;\n\nnamespace LEGUI\n{\n    /// <summary>\n    ///     Interaction logic for MaskTextBox.xaml\n    /// </summary>\n    public partial class MaskedTextBox : TextBox\n    {\n        private string _maskText = string.Empty;\n\n        public MaskedTextBox()\n        {\n            InitializeComponent();\n        }\n\n        public string MaskText\n        {\n            get { return _maskText; }\n            set\n            {\n                _maskText = value;\n\n                if (string.IsNullOrEmpty(base.Text))\n                {\n                    base.Text = MaskText;\n                    FontStyle = FontStyles.Italic;\n                }\n            }\n        }\n\n        public new string Text\n        {\n            get\n            {\n                if (base.Text == MaskText && FontStyle == FontStyles.Italic)\n                {\n                    return string.Empty;\n                }\n                return base.Text;\n            }\n            set\n            {\n                if (string.IsNullOrEmpty(value))\n                {\n                    base.Text = MaskText;\n                    FontStyle = FontStyles.Italic;\n                }\n                else\n                {\n                    base.Text = value;\n                    FontStyle = FontStyles.Normal;\n                }\n            }\n        }\n\n        protected override void OnLostFocus(RoutedEventArgs e)\n        {\n            if (string.IsNullOrEmpty(Text))\n            {\n                base.Text = MaskText;\n                FontStyle = FontStyles.Italic;\n            }\n\n            base.OnLostFocus(e);\n        }\n\n        protected override void OnGotFocus(RoutedEventArgs e)\n        {\n            if (base.Text == MaskText && FontStyle == FontStyles.Italic)\n            {\n                base.Text = string.Empty;\n                FontStyle = FontStyles.Normal;\n            }\n\n            base.OnGotFocus(e);\n        }\n    }\n}"
  },
  {
    "path": "LEGUI/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"LEGUI\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Paddy Xu\")]\n[assembly: AssemblyProduct(\"LEGUI\")]\n[assembly: AssemblyCopyright(\"Copyright © Paddy Xu 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n[assembly: ThemeInfo(ResourceDictionaryLocation.None, //where theme specific resource dictionaries are Localed\n    //(used if a resource is not found in the page, \n    // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is Localed\n    //(used if a resource is not found in the page, \n    // app, or any theme specific resource dictionaries)\n    )]"
  },
  {
    "path": "LEGUI/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34003\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEGUI.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"LEGUI.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEGUI/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "LEGUI/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34003\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEGUI.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEGUI/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "LEGUI/ShellLink.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace LEGUI\n{\n    [ComImport]\n    [Guid(\"00021401-0000-0000-C000-000000000046\")]\n    internal class ShellLink\n    {\n    }\n\n    [ComImport]\n    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]\n    [Guid(\"000214F9-0000-0000-C000-000000000046\")]\n    internal interface IShellLink\n    {\n        void GetPath([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,\n                     int cchMaxPath,\n                     out IntPtr pfd,\n                     int fFlags);\n\n        void GetIDList(out IntPtr ppidl);\n        void SetIDList(IntPtr pidl);\n        void GetDescription([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName, int cchMaxName);\n        void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName);\n        void GetWorkingDirectory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath);\n        void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir);\n        void GetArguments([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath);\n        void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs);\n        void GetHotkey(out short pwHotkey);\n        void SetHotkey(short wHotkey);\n        void GetShowCmd(out int piShowCmd);\n        void SetShowCmd(int iShowCmd);\n\n        void GetIconLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszIconPath,\n                             int cchIconPath,\n                             out int piIcon);\n\n        void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon);\n        void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, int dwReserved);\n        void Resolve(IntPtr hwnd, int fFlags);\n        void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile);\n    }\n}"
  },
  {
    "path": "LEInstaller/Form1.Designer.cs",
    "content": "﻿namespace LEInstaller\n{\n    partial class Form1\n    {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing && (components != null))\n            {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent()\n        {\n            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));\n            this.buttonInstall = new System.Windows.Forms.Button();\n            this.buttonUninstall = new System.Windows.Forms.Button();\n            this.buttonUninstallAllUsers = new System.Windows.Forms.Button();\n            this.label1 = new System.Windows.Forms.Label();\n            this.groupBox1 = new System.Windows.Forms.GroupBox();\n            this.groupBox2 = new System.Windows.Forms.GroupBox();\n            this.buttonInstallAllUsers = new System.Windows.Forms.Button();\n            this.buttonEditGlobal = new System.Windows.Forms.Button();\n            this.groupBox3 = new System.Windows.Forms.GroupBox();\n            this.groupBox1.SuspendLayout();\n            this.groupBox2.SuspendLayout();\n            this.groupBox3.SuspendLayout();\n            this.SuspendLayout();\n            // \n            // buttonInstall\n            // \n            this.buttonInstall.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.buttonInstall.Location = new System.Drawing.Point(30, 33);\n            this.buttonInstall.Margin = new System.Windows.Forms.Padding(6);\n            this.buttonInstall.Name = \"buttonInstall\";\n            this.buttonInstall.Size = new System.Drawing.Size(328, 48);\n            this.buttonInstall.TabIndex = 0;\n            this.buttonInstall.Text = \"Install for current user\";\n            this.buttonInstall.UseVisualStyleBackColor = true;\n            this.buttonInstall.Click += new System.EventHandler(this.buttonInstall_Click);\n            // \n            // buttonUninstall\n            // \n            this.buttonUninstall.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.buttonUninstall.Location = new System.Drawing.Point(372, 33);\n            this.buttonUninstall.Margin = new System.Windows.Forms.Padding(6);\n            this.buttonUninstall.Name = \"buttonUninstall\";\n            this.buttonUninstall.Size = new System.Drawing.Size(328, 48);\n            this.buttonUninstall.TabIndex = 1;\n            this.buttonUninstall.Text = \"Uninstall for current user\";\n            this.buttonUninstall.UseVisualStyleBackColor = true;\n            this.buttonUninstall.Click += new System.EventHandler(this.buttonUninstall_Click);\n            // \n            // buttonUninstallAllUsers\n            // \n            this.buttonUninstallAllUsers.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.buttonUninstallAllUsers.Location = new System.Drawing.Point(372, 33);\n            this.buttonUninstallAllUsers.Margin = new System.Windows.Forms.Padding(6);\n            this.buttonUninstallAllUsers.Name = \"buttonUninstallAllUsers\";\n            this.buttonUninstallAllUsers.Size = new System.Drawing.Size(328, 48);\n            this.buttonUninstallAllUsers.TabIndex = 3;\n            this.buttonUninstallAllUsers.Text = \"Uninstall for all users\";\n            this.buttonUninstallAllUsers.UseVisualStyleBackColor = true;\n            this.buttonUninstallAllUsers.Click += new System.EventHandler(this.buttonUninstallAllUsers_Click);\n            // \n            // label1\n            // \n            this.label1.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.label1.Location = new System.Drawing.Point(16, 23);\n            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\n            this.label1.Name = \"label1\";\n            this.label1.Size = new System.Drawing.Size(726, 231);\n            this.label1.TabIndex = 4;\n            this.label1.Text = resources.GetString(\"label1.Text\");\n            // \n            // groupBox1\n            // \n            this.groupBox1.Controls.Add(this.buttonInstall);\n            this.groupBox1.Controls.Add(this.buttonUninstall);\n            this.groupBox1.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.groupBox1.Location = new System.Drawing.Point(14, 271);\n            this.groupBox1.Margin = new System.Windows.Forms.Padding(4);\n            this.groupBox1.Name = \"groupBox1\";\n            this.groupBox1.Padding = new System.Windows.Forms.Padding(4);\n            this.groupBox1.Size = new System.Drawing.Size(728, 100);\n            this.groupBox1.TabIndex = 5;\n            this.groupBox1.TabStop = false;\n            this.groupBox1.Text = \"(1.1) Install for yourself\";\n            // \n            // groupBox2\n            // \n            this.groupBox2.Controls.Add(this.buttonInstallAllUsers);\n            this.groupBox2.Controls.Add(this.buttonUninstallAllUsers);\n            this.groupBox2.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.groupBox2.Location = new System.Drawing.Point(14, 376);\n            this.groupBox2.Margin = new System.Windows.Forms.Padding(4);\n            this.groupBox2.Name = \"groupBox2\";\n            this.groupBox2.Padding = new System.Windows.Forms.Padding(4);\n            this.groupBox2.Size = new System.Drawing.Size(728, 100);\n            this.groupBox2.TabIndex = 6;\n            this.groupBox2.TabStop = false;\n            this.groupBox2.Text = \"(1.2) ... or install for all users on this PC (requires admin)\";\n            // \n            // buttonInstallAllUsers\n            // \n            this.buttonInstallAllUsers.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.buttonInstallAllUsers.Location = new System.Drawing.Point(30, 33);\n            this.buttonInstallAllUsers.Margin = new System.Windows.Forms.Padding(6);\n            this.buttonInstallAllUsers.Name = \"buttonInstallAllUsers\";\n            this.buttonInstallAllUsers.Size = new System.Drawing.Size(328, 48);\n            this.buttonInstallAllUsers.TabIndex = 2;\n            this.buttonInstallAllUsers.Text = \"Install for all users\";\n            this.buttonInstallAllUsers.UseVisualStyleBackColor = true;\n            this.buttonInstallAllUsers.Click += new System.EventHandler(this.buttonInstallAllUsers_Click);\n            // \n            // buttonEditGlobal\n            // \n            this.buttonEditGlobal.Enabled = false;\n            this.buttonEditGlobal.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.buttonEditGlobal.Location = new System.Drawing.Point(31, 34);\n            this.buttonEditGlobal.Margin = new System.Windows.Forms.Padding(6);\n            this.buttonEditGlobal.Name = \"buttonEditGlobal\";\n            this.buttonEditGlobal.Size = new System.Drawing.Size(670, 48);\n            this.buttonEditGlobal.TabIndex = 4;\n            this.buttonEditGlobal.Text = \"Edit global profile list\";\n            this.buttonEditGlobal.UseVisualStyleBackColor = true;\n            this.buttonEditGlobal.Click += new System.EventHandler(this.buttonEditGlobal_Click);\n            // \n            // groupBox3\n            // \n            this.groupBox3.Controls.Add(this.buttonEditGlobal);\n            this.groupBox3.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 7.8F);\n            this.groupBox3.Location = new System.Drawing.Point(14, 484);\n            this.groupBox3.Margin = new System.Windows.Forms.Padding(4);\n            this.groupBox3.Name = \"groupBox3\";\n            this.groupBox3.Padding = new System.Windows.Forms.Padding(4);\n            this.groupBox3.Size = new System.Drawing.Size(728, 100);\n            this.groupBox3.TabIndex = 7;\n            this.groupBox3.TabStop = false;\n            this.groupBox3.Text = \"(2) Customise your profiles\";\n            // \n            // Form1\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.BackColor = System.Drawing.SystemColors.Window;\n            this.ClientSize = new System.Drawing.Size(752, 602);\n            this.Controls.Add(this.groupBox3);\n            this.Controls.Add(this.groupBox2);\n            this.Controls.Add(this.groupBox1);\n            this.Controls.Add(this.label1);\n            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;\n            this.Margin = new System.Windows.Forms.Padding(6);\n            this.MaximizeBox = false;\n            this.MinimizeBox = false;\n            this.Name = \"Form1\";\n            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\n            this.Text = \"LE Context Menu Installer\";\n            this.TopMost = true;\n            this.Load += new System.EventHandler(this.Form1_Load);\n            this.groupBox1.ResumeLayout(false);\n            this.groupBox2.ResumeLayout(false);\n            this.groupBox3.ResumeLayout(false);\n            this.ResumeLayout(false);\n\n        }\n\n        #endregion\n\n        private System.Windows.Forms.Button buttonInstall;\n        private System.Windows.Forms.Button buttonUninstall;\n        private System.Windows.Forms.Button buttonUninstallAllUsers;\n        private System.Windows.Forms.Label label1;\n        private System.Windows.Forms.GroupBox groupBox1;\n        private System.Windows.Forms.GroupBox groupBox2;\n        private System.Windows.Forms.Button buttonInstallAllUsers;\n        private System.Windows.Forms.Button buttonEditGlobal;\n        private System.Windows.Forms.GroupBox groupBox3;\n    }\n}\n\n"
  },
  {
    "path": "LEInstaller/Form1.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Windows.Forms;\nusing System.Xml.Linq;\nusing LEInstaller.Properties;\nusing System.Security.Principal;\n\nnamespace LEInstaller\n{\n    public partial class Form1 : Form\n    {\n        private int cmdMode = 0;\n        private readonly string crtDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);\n        \n        public Form1(int CmdMode=0)\n        {\n            // We need to remove all ADS first.\n            // https://github.com/xupefei/Locale-Emulator/issues/22.\n            foreach (var f in Directory.GetFiles(crtDir, \"*\", SearchOption.AllDirectories))\n                RemoveADS(f);\n\n            DisableDPIScale();\n\n            InitializeComponent();\n            cmdMode = CmdMode;\n        }\n\n        private void RunAsAdmin(string Arguments=\"\")\n        {\n            var startup = new ProcessStartInfo();\n            startup.WindowStyle = ProcessWindowStyle.Normal;\n            startup.UseShellExecute = true;\n            startup.WorkingDirectory = Environment.CurrentDirectory;\n            startup.Arguments = Arguments;\n            startup.FileName = Application.ExecutablePath;\n            startup.Verb = \"runas\";\n\n            try\n            {\n                using (var proc = Process.Start(startup))\n                {\n                    Environment.Exit(0);\n                    return;\n                }\n            }\n            catch (SystemException)\n            {\n                MessageBox.Show(this,\"Error with Launching Application as administrator\\r\\n\"+ \n                    \"\\r\\n\"+\n                    \"Please run this application as administrator and try again.\",\n                    \"LE Context Menu Installer\",\n                    MessageBoxButtons.OK,\n                    MessageBoxIcon.Error);\n                return;\n            }\n        }\n\n        private void Form1_Load(object sender, EventArgs e)\n        {\n            if (Environment.OSVersion.Version.CompareTo(new Version(6, 0)) <= 0)\n            {\n                MessageBox.Show(this, \"Sorry, Locale Emulator is only for Windows 7, 8/8.1 and 10.\",\n                    \"OS Outdated\",\n                    MessageBoxButtons.OK,\n                    MessageBoxIcon.Error);\n\n                Environment.Exit(0);\n            }\n\n            Text += \" - V\" + GetLEVersion();\n\n            if (IsAdministrator())\n            {\n                Text += \" (Administrator)\";\n\n                buttonInstall.Enabled = false;\n            }\n\n            DeleteOldFiles();\n            ReplaceDll();\n\n            AddShieldToButton(buttonInstallAllUsers);\n            AddShieldToButton(buttonUninstallAllUsers);\n\n            buttonUninstall.Enabled = ShellExtensionManager.IsInstalled(false);\n            buttonUninstallAllUsers.Enabled = ShellExtensionManager.IsInstalled(true);\n            buttonEditGlobal.Enabled = ShellExtensionManager.IsInstalled(true) || ShellExtensionManager.IsInstalled(false);\n\n            switch (cmdMode)\n            {\n                case 1:\n                    buttonInstallAllUsers.PerformClick();\n                    break;\n                case 2:\n                    buttonUninstallAllUsers.PerformClick();\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        private void buttonInstall_Click(object sender, EventArgs e)\n        {\n            DoRegister(false);\n\n            NotifyShell();\n\n            MessageBox.Show(this, \"Install finished. Right click any executable and enjoy :)\\r\\n\" +\n                            \"\\r\\n\" +\n                            \"PS: A reboot (or restart of \\\"explorer.exe\\\") is required if you are upgrading from an old version.\",\n                \"LE Context Menu Installer\",\n                MessageBoxButtons.OK,\n                MessageBoxIcon.Information);\n\n            buttonUninstall.Enabled = true;\n            buttonEditGlobal.Enabled = true;\n        }\n\n        private void buttonInstallAllUsers_Click(object sender, EventArgs e)\n        {\n            if (!IsAdministrator())\n            {\n                /*MessageBox.Show(this, \"Please run this application as administrator and try again.\",\n                    \"LE Context Menu Installer\",\n                    MessageBoxButtons.OK,\n                    MessageBoxIcon.Error);*/\n                \n                RunAsAdmin(\"--InstallAll\");\n                return;\n            }\n\n            DoRegister(true);\n\n            NotifyShell();\n\n            MessageBox.Show(this, \"Install finished. Right click any executable and enjoy :)\\r\\n\" +\n                            \"\\r\\n\" +\n                            \"PS: A reboot (or restart of \\\"explorer.exe\\\") is required if you are upgrading from an old version.\",\n                \"LE Context Menu Installer\",\n                MessageBoxButtons.OK,\n                MessageBoxIcon.Information);\n\n            buttonUninstallAllUsers.Enabled = true;\n            buttonEditGlobal.Enabled = true;\n        }\n\n        private void buttonEditGlobal_Click(object sender, EventArgs e)\n        {\n            Process.Start(Path.Combine(crtDir, \"LEGUI.exe\"));\n            Application.Exit();\n        }\n\n        public static void DisableDPIScale()\n        {\n            SetProcessDPIAware();\n        }\n\n        private void RemoveADS(string s)\n        {\n            File.SetAttributes(s, FileAttributes.Normal);\n\n            if (DeleteFile(s + \":Zone.Identifier\") == 0)\n            {\n                SetLastError(0);\n            }\n        }\n\n        private void buttonUninstall_Click(object sender, EventArgs e)\n        {\n            DoUnRegister(false);\n\n            NotifyShell();\n\n            MessageBox.Show(this, \"Uninstall finished. Thanks for using Locale Emulator :)\\r\\n\" +\n                            \"\\r\\n\" +\n                            \"PS: A reboot is required to unlock some components.\",\n                \"LE Context Menu Installer\",\n                MessageBoxButtons.OK,\n                MessageBoxIcon.Information);\n\n            buttonUninstall.Enabled = false;\n        }\n\n        private void buttonUninstallAllUsers_Click(object sender, EventArgs e)\n        {\n            if (!IsAdministrator())\n            {\n                /*MessageBox.Show(this, \"Please run this application as administrator and try again.\",\n                    \"LE Context Menu Installer\",\n                    MessageBoxButtons.OK,\n                    MessageBoxIcon.Error);*/\n\n                \n                RunAsAdmin(\"--UninstallAll\");\n                return;\n            }\n\n            DoUnRegister(true);\n\n            NotifyShell();\n\n            MessageBox.Show(this, \"Uninstall finished. Thanks for using Locale Emulator :)\\r\\n\" +\n                            \"\\r\\n\" +\n                            \"PS: A reboot is required to unlock some components.\",\n                \"LE Context Menu Installer\",\n                MessageBoxButtons.OK,\n                MessageBoxIcon.Information);\n\n            buttonUninstallAllUsers.Enabled = false;\n        }\n\n        protected override void OnClosing(CancelEventArgs e)\n        {\n            Environment.Exit(0);\n        }\n\n        private void DoRegister(bool allUsers)\n        {\n            try\n            {\n                if (!allUsers)\n                    OverrideHKCR();\n\n                var rs = new RegistrationServices();\n                rs.RegisterAssembly(Assembly.LoadFrom(Path.Combine(crtDir, @\"LEContextMenuHandler.dll\")),\n                    AssemblyRegistrationFlags.SetCodeBase);\n\n                ShellExtensionManager.RegisterShellExtContextMenuHandler(allUsers);\n\n                if (!allUsers)\n                    OverrideHKCR(true);\n            }\n            catch (Exception e)\n            {\n                MessageBox.Show(this, e.Message + \"\\r\\n\\r\\n\" + e.StackTrace);\n            }\n        }\n\n        private void DoUnRegister(bool allUsers)\n        {\n            try\n            {\n                if (!allUsers)\n                    OverrideHKCR();\n\n                var rs = new RegistrationServices();\n                rs.UnregisterAssembly(Assembly.LoadFrom(Path.Combine(crtDir, @\"LEContextMenuHandler.dll\")));\n\n                ShellExtensionManager.UnregisterShellExtContextMenuHandler(allUsers);\n\n                if (!allUsers)\n                    OverrideHKCR(true);\n            }\n            catch (Exception e)\n            {\n                MessageBox.Show(this, e.Message + \"\\r\\n\\r\\n\" + e.StackTrace);\n            }\n        }\n\n        private void OverrideHKCR(bool restore = false)\n        {\n            UIntPtr HKEY_CLASSES_ROOT = Is64BitOS() ? new UIntPtr(0xFFFFFFFF80000000) : new UIntPtr(0x80000000);\n            UIntPtr HKEY_CURRENT_USER = Is64BitOS() ? new UIntPtr(0xFFFFFFFF80000001) : new UIntPtr(0x80000001);\n\n            // 0xF003F = KEY_ALL_ACCESS\n            UIntPtr key = UIntPtr.Zero;\n\n            RegOpenKeyEx(HKEY_CURRENT_USER, @\"Software\\Classes\", 0, 0xF003F, out key);\n            RegOverridePredefKey(HKEY_CLASSES_ROOT, restore ? UIntPtr.Zero : key);\n        }\n\n        private void DeleteOldFiles()\n        {\n            foreach (var file in Directory.EnumerateFiles(crtDir, \"*.installer.bak\"))\n            {\n                try\n                {\n                    File.Delete(file);\n                }\n                catch (Exception)\n                {\n                }\n            }\n        }\n\n        private bool ReplaceDll()\n        {\n            var dllPath1 = Path.Combine(crtDir, @\"LEContextMenuHandler.dll\");\n            var dllPath2 = Path.Combine(crtDir, @\"LECommonLibrary.dll\");\n\n            // try delete old files. If failed, rename them\n            try\n            {\n                File.Delete(dllPath1);\n                File.Delete(dllPath2);\n            }\n            catch (Exception)\n            {\n                try\n                {\n                    File.Move(dllPath1, $\"{Guid.NewGuid()}.installer.bak\");\n                    File.Move(dllPath2, $\"{Guid.NewGuid()}.installer.bak\");\n                }\n                catch (Exception ee)\n                {\n                    MessageBox.Show(this, ee.Message + \"\\r\\nPlease try rebooting your PC.\");\n                    return false;\n                }\n            }\n\n            // Write new files\n            try\n            {\n                File.WriteAllBytes(dllPath1, Resources.LEContextMenuHandler);\n                File.WriteAllBytes(dllPath2, Resources.LECommonLibrary);\n\n                return true;\n            }\n            catch (Exception e)\n            {\n                MessageBox.Show(this, e.Message + \"\\r\\nPlease try install/uninstall again.\");\n                return false;\n            }\n        }\n\n        private void NotifyShell()\n        {\n            const uint SHCNE_ASSOCCHANGED = 0x08000000;\n            const ushort SHCNF_IDLIST = 0x0000;\n\n            SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);\n        }\n\n        static internal void AddShieldToButton(Button b)\n        {\n            const uint BCM_FIRST = 0x1600; //Normal button\n            const uint BCM_SETSHIELD = (BCM_FIRST + 0x000C); //Elevated button\n\n            b.FlatStyle = FlatStyle.System;\n            SendMessage(b.Handle, BCM_SETSHIELD, 0, 0xFFFFFFFF);\n        }\n\n        // We should not use the LECommonLibrary.\n        private static string GetLEVersion()\n        {\n            try\n            {\n                var versionPath =\n                    Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                        \"LEVersion.xml\");\n\n                var doc = XDocument.Load(versionPath);\n\n                return doc.Descendants(\"LEVersion\").First().Attribute(\"Version\").Value;\n            }\n            catch\n            {\n                return \"0.0.0.0\";\n            }\n        }\n\n        public static bool IsAdministrator()\n        {\n            var wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());\n\n            return wp.IsInRole(WindowsBuiltInRole.Administrator);\n        }\n\n        private static bool Is64BitOS()\n        {\n            //The code below is from http://1code.codeplex.com/SourceControl/changeset/view/39074#842775\n            //which is under the Microsoft Public License: http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.\n\n            if (UIntPtr.Size == 8) // 64-bit programs run only on Win64\n            {\n                return true;\n            }\n            // Detect whether the current process is a 32-bit process \n            // running on a 64-bit system.\n            bool flag;\n            return DoesWin32MethodExist(\"kernel32.dll\", \"IsWow64Process\") &&\n                   IsWow64Process(GetCurrentProcess(), out flag) && flag;\n        }\n\n        private static bool DoesWin32MethodExist(string moduleName, string methodName)\n        {\n            var moduleHandle = GetModuleHandle(moduleName);\n            if (moduleHandle == UIntPtr.Zero)\n            {\n                return false;\n            }\n            return GetProcAddress(moduleHandle, methodName) != UIntPtr.Zero;\n        }\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode, SetLastError = true)]\n        private static extern int DeleteFile(string name);\n\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\n        private static extern void SetLastError(int errorCode);\n\n        [DllImport(\"shell32.dll\", SetLastError = true)]\n        private static extern void SHChangeNotify(uint wEventId, ushort uFlags, IntPtr dwItem1, IntPtr dwItem2);\n\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\n        private static extern UIntPtr GetCurrentProcess();\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto)]\n        private static extern UIntPtr GetModuleHandle(string moduleName);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        private static extern UIntPtr GetProcAddress(UIntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string procName);\n\n        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        [return: MarshalAs(UnmanagedType.Bool)]\n        private static extern bool IsWow64Process(UIntPtr hProcess, out bool wow64Process);\n\n        [DllImport(\"advapi32.dll\", CharSet = CharSet.Unicode)]\n        private static extern int RegOpenKeyEx(UIntPtr hKey, string subKey, int ulOptions, uint samDesired,\n            out UIntPtr hkResult);\n\n        [DllImport(\"advapi32.dll\", SetLastError = true)]\n        private static extern int RegOverridePredefKey(UIntPtr hKey, UIntPtr hNewKey);\n\n        [DllImport(\"advapi32.dll\", SetLastError = true)]\n        public static extern int RegCloseKey(UIntPtr hKey);\n\n        [DllImport(\"user32.dll\", SetLastError = true)]\n        static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);\n\n        [DllImport(\"user32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n        static extern IntPtr FindWindow(string lpClassName, string lpWindowName);\n\n        [DllImport(\"user32.dll\", SetLastError = true)]\n        public static extern UInt32 SendMessage(IntPtr hWnd, UInt32 msg, UInt32 wParam, UInt32 lParam);\n\n        [DllImport(\"user32.dll\")]\n        private static extern bool SetProcessDPIAware();\n\n        private void ButtonExtract_Click(object sender, EventArgs e)\n        {\n\n        }\n    }\n}"
  },
  {
    "path": "LEInstaller/Form1.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"label1.Text\" xml:space=\"preserve\">\n    <value>Welcome to Locale Emulator!\nIf you want to use LE without installation (i.e., portable application), you can close the window now.\nOtherwise, please follow the steps below to install LE:\n   1. Install Locale Emulator (1.1) for yourself or (1.2) for all users on this PC (requires admin rights).\n   2. Run LEGUI.exe to customise the profile list;\n   3. Right-click on any application and you will see the Locale Emulator items. Enjoy!</value>\n  </data>\n</root>"
  },
  {
    "path": "LEInstaller/LEInstaller.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{E218923D-59A4-4FA5-B4BC-E540290DA3F8}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>LEInstaller</RootNamespace>\n    <AssemblyName>LEInstaller</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\Build\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\Build\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>icon.ico</ApplicationIcon>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"LECommonLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a5ce8326c28d7c91, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\LECommonLibrary\\bin\\Release\\LECommonLibrary.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Configuration.Install\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Form1.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"Form1.Designer.cs\">\n      <DependentUpon>Form1.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"ShellExtensionManager.cs\" />\n    <EmbeddedResource Include=\"Form1.resx\">\n      <DependentUpon>Form1.cs</DependentUpon>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <SubType>Designer</SubType>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"app.manifest\" />\n    <None Include=\"key.snk\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"icon.ico\" />\n    <None Include=\"Resources\\LECommonLibrary.dll\" />\n    <None Include=\"Resources\\LEContextMenuHandler.dll\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\LEContextMenuHandler\\LEContextMenuHandler.csproj\">\n      <Project>{0041073D-2FA7-4B35-B904-9C606C89C8CD}</Project>\n      <Name>LEContextMenuHandler</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "LEInstaller/Program.cs",
    "content": "﻿using System;\nusing System.Windows.Forms;\n\nnamespace LEInstaller\n{\n    internal static class Program\n    {\n        /// <summary>\n        ///     The main entry point for the application.\n        /// </summary>\n        [STAThread]\n        private static void Main(string[] args)\n        {\n            Application.EnableVisualStyles();\n            Application.SetCompatibleTextRenderingDefault(false);\n            Form1 form1=null;\n            if (args.Length == 1)\n            {\n                if (args[0] == \"--InstallAll\")\n                    form1 = new Form1(1);\n                else if (args[0] == \"--UninstallAll\")\n                    form1 = new Form1(2);\n                else\n                    form1 = new Form1();\n            }\n            else\n                form1 = new Form1();\n            Application.Run(form1);\n\n            \n\n            \n        }\n    }\n}"
  },
  {
    "path": "LEInstaller/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"LEInstaller\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Paddy Xu\")]\n[assembly: AssemblyProduct(\"LEInstaller\")]\n[assembly: AssemblyCopyright(\"Copyright © Paddy Xu 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"e021dc51-1300-4d56-973c-155c5de14940\")]"
  },
  {
    "path": "LEInstaller/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEInstaller.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"LEInstaller.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Byte[].\n        /// </summary>\n        internal static byte[] LECommonLibrary {\n            get {\n                object obj = ResourceManager.GetObject(\"LECommonLibrary\", resourceCulture);\n                return ((byte[])(obj));\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Byte[].\n        /// </summary>\n        internal static byte[] LEContextMenuHandler {\n            get {\n                object obj = ResourceManager.GetObject(\"LEContextMenuHandler\", resourceCulture);\n                return ((byte[])(obj));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEInstaller/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"LEContextMenuHandler\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>..\\Resources\\LEContextMenuHandler.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n  <data name=\"LECommonLibrary\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>..\\Resources\\LECommonLibrary.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </data>\n</root>"
  },
  {
    "path": "LEInstaller/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34003\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEInstaller.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEInstaller/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "LEInstaller/Resources/.gitignore",
    "content": "/LEContextMenuHandler.dll\n/LECommonLibrary.dll\n"
  },
  {
    "path": "LEInstaller/ShellExtensionManager.cs",
    "content": "﻿using Microsoft.Win32;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace LEInstaller\n{\n    class ShellExtensionManager\n    {\n        private static string clsid = \"{C52B9871-E5E9-41FD-B84D-C5ACADBEC7AE}\";\n        private static string fileType = \"*\";\n        private static string friendlyName = \"LocaleEmulator.LEContextMenuHandler Class\";\n        private static string keyName = $@\"Software\\Classes\\{fileType}\\shellex\\ContextMenuHandlers\\{clsid}\";\n\n        public static void RegisterShellExtContextMenuHandler(bool allUsers)\n        {\n            var rootName = allUsers ? Registry.LocalMachine : Registry.CurrentUser;\n\n            using (var key = rootName.CreateSubKey(keyName))\n            {\n                key?.SetValue(null, friendlyName);\n            }\n        }\n\n        public static void UnregisterShellExtContextMenuHandler(bool allUsers)\n        {\n            var rootName = allUsers ? Registry.LocalMachine : Registry.CurrentUser;\n\n            rootName.DeleteSubKeyTree(keyName);\n        }\n\n        public static bool IsInstalled(bool allUsers)\n        {\n            var rootName = allUsers ? Registry.LocalMachine : Registry.CurrentUser;\n\n            return rootName.OpenSubKey(keyName, false) != null;\n        }\n    }\n}"
  },
  {
    "path": "LEInstaller/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<asmv1:assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv1=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"MyApplication.app\"/>\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n    <security>\n      <requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <!-- UAC Manifest Options\n            If you want to change the Windows User Account Control level replace the \n            requestedExecutionLevel node with one of the following.\n\n        <requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n            Specifying requestedExecutionLevel node will disable file and registry virtualization.\n            If you want to utilize File and Registry Virtualization for backward \n            compatibility then delete the requestedExecutionLevel node.\n        <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n        -->\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!-- A list of all Windows versions that this application is designed to work with. \n      Windows will automatically select the most compatible environment.-->\n\n      <!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->\n      <!--<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"></supportedOS>-->\n\n      <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->\n      <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n\n      <!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->\n      <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"></supportedOS>\n\n      <!-- Windows 10 -->\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n      \n    </application>\n  </compatibility>\n\n  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n  <!-- <dependency>\n    <dependentAssembly>\n      <assemblyIdentity\n          type=\"win32\"\n          name=\"Microsoft.Windows.Common-Controls\"\n          version=\"6.0.0.0\"\n          processorArchitecture=\"*\"\n          publicKeyToken=\"6595b64144ccf1df\"\n          language=\"*\"\n        />\n    </dependentAssembly>\n  </dependency>-->\n\n</asmv1:assembly>\n"
  },
  {
    "path": "LEProc/Amemiya.Extensions.ArrayExtensions.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\n\nnamespace Amemiya.Extensions\n{\n    public static class ArrayExtensions\n    {\n        /// <summary>\n        ///     Convert a struct into a binary array.\n        /// </summary>\n        /// <returns>The binary array</returns>\n        public static byte[] StructToBytes(object structObj)\n        {\n            var size = Marshal.SizeOf(structObj);\n            var buffer = Marshal.AllocHGlobal(size);\n            try\n            {\n                Marshal.StructureToPtr(structObj, buffer, true);\n                var bytes = new byte[size];\n                Marshal.Copy(buffer, bytes, 0, size);\n                return bytes;\n            }\n            finally\n            {\n                Marshal.FreeHGlobal(buffer);\n            }\n        }\n\n        /// <summary>\n        ///     Combine two arrays into one\n        /// </summary>\n        /// <returns>The new array</returns>\n        public static T[] CombineWith<T>(this T[] source, T[] with)\n        {\n            if (source == null || source.Length == 0)\n                return with;\n\n            var newBytes = new T[source.Length + with.Length];\n\n            SetRange(newBytes, source, 0);\n            SetRange(newBytes, with, source.Length);\n\n            return newBytes;\n        }\n\n        /// <summary>\n        ///     Compare the two arrays\n        /// </summary>\n        /// <returns>True if they are equal</returns>\n        public static bool EqualWith<T>(this T[] source, T[] compareWith)\n        {\n            if (source.Length != compareWith.Length)\n                return false;\n\n            if (source.Where((t, i) => !EqualityComparer<T>.Default.Equals(t, compareWith[i])).Any())\n                return false;\n\n            return true;\n        }\n\n        /// <summary>\n        ///     Expand current array to a lager one\n        /// </summary>\n        /// <returns>The new array</returns>\n        public static byte[] ExpandTo(this byte[] source, int newLength)\n        {\n            if (source.Length > newLength)\n                return source;\n\n            var b = new byte[newLength];\n            FillWith(b, (byte)0);\n\n            SetRange(b, source, 0);\n\n            return b;\n        }\n\n        /// <summary>\n        ///     Fill every item of current array with \"with\"\n        /// </summary>\n        public static void FillWith<T>(this T[] source, T with)\n        {\n            for (var i = 0; i < source.Length; i++)\n                source[i] = with;\n        }\n\n        /// <summary>\n        ///     Locate an array index in current array\n        /// </summary>\n        /// <returns>-1 if not-found</returns>\n        public static int IndexOf<T>(this T[] source, T[] arrayToFind, int startAt, bool isBackward)\n        {\n            if (isBackward)\n            {\n                for (var index = startAt - arrayToFind.Length; index >= 0; --index)\n                {\n                    if (EqualWith(Slice(source, index, arrayToFind.Length + index), arrayToFind))\n                        return index;\n                }\n                return -1;\n            }\n\n            for (var index = startAt; index <= source.Length - arrayToFind.Length; ++index)\n            {\n                if (EqualWith(Slice(source, index, arrayToFind.Length + index), arrayToFind))\n                    return index;\n            }\n            return -1;\n        }\n\n        /// <summary>\n        ///     Set current array to bytesValue, starting from startFrom\n        /// </summary>\n        public static void SetRange<T>(this T[] source, T[] bytesValue, int startFrom)\n        {\n            if (source.Length < bytesValue.Length + startFrom)\n                throw new Exception(\"dest too small\");\n\n            Array.Copy(bytesValue, 0, source, startFrom, bytesValue.Length);\n        }\n\n        public static T[] Slice<T>(this T[] source, int start, int end)\n        {\n            if (end < 0)\n            {\n                end = source.Length + end;\n            }\n            var len = end - start;\n\n            var res = new T[len];\n            for (var i = 0; i < len; i++)\n            {\n                res[i] = source[i + start];\n            }\n            return res;\n        }\n    }\n}"
  },
  {
    "path": "LEProc/LEProc.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{A2CF5369-4665-49F6-B948-B44296002C3D}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>LEProc</RootNamespace>\n    <AssemblyName>LEProc</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\Build\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>x86</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\Build\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup />\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Amemiya.Extensions.ArrayExtensions.cs\" />\n    <Compile Include=\"RegistryEntriesLoader.cs\" />\n    <Compile Include=\"RegistryEntry.cs\" />\n    <Compile Include=\"LoaderWrapper.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"LERegistryRedirector.cs\" />\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"app.manifest\" />\n    <None Include=\"key.snk\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\LECommonLibrary\\LECommonLibrary.csproj\">\n      <Project>{c4def32b-8fbb-41b6-80dc-c60339402323}</Project>\n      <Name>LECommonLibrary</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5.1\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5.1 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"LEVersion.xml\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n      <SubType>Designer</SubType>\n    </Content>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "LEProc/LERegistryRedirector.cs",
    "content": "﻿/*\n * This is a *dirty* implementation due to the lack of support of StructureToPtr(struct-has-non-fix-lengthed-array).\n * Maybe I will try another methods in the future.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Windows.Forms;\nusing Amemiya.Extensions;\n\nnamespace LEProc\n{\n    internal class LERegistryRedirector\n    {\n        /// <summary>\n        ///     Registry Root flags\n        /// </summary>\n        private static readonly Dictionary<string, ulong> _regKeyFlags =\n            new Dictionary<string, ulong>\n            {\n                {\"HKEY_CLASSES_ROOT\", 0x80000000},\n                {\"HKEY_CURRENT_USER\", 0x80000001},\n                {\"HKEY_LOCAL_MACHINE\", 0x80000002},\n                {\"HKEY_USERS\", 0x80000003},\n                {\"HKEY_CURRENT_CONFIG\", 0x80000005}\n            };\n\n        /// <summary>\n        ///     Registry data types\n        /// </summary>\n        private static readonly Dictionary<string, uint> _regTypeFlags =\n            new Dictionary<string, uint>\n            {\n                {\"REG_SZ\", 1},\n                {\"REG_EXPAND_SZ\", 2},\n                {\"REG_BINARY\", 3},\n                {\"REG_DWORD\", 4},\n                {\"REG_MULTI_SZ\", 7},\n                {\"REG_QWORD\", 11}\n            };\n\n        private readonly List<byte> _objectData = new List<byte>();\n        private readonly List<REGISTRY_REDIRECTION_ENTRY64> _registryReplacement;\n\n        /// <summary>\n        ///     Initialize\n        /// </summary>\n        /// <param name=\"count\">Sum of registry entries</param>\n        internal LERegistryRedirector(int count)\n        {\n            NumberOfRegistryRedirectionEntries = count;\n\n            _registryReplacement = new List<REGISTRY_REDIRECTION_ENTRY64>(count);\n        }\n\n        /// <summary>\n        ///     Number of registry redirection entries.\n        /// </summary>\n        internal int NumberOfRegistryRedirectionEntries { get; set; }\n\n        /// <summary>\n        ///     Get data in binary array format\n        /// </summary>\n        internal byte[] GetBinaryData()\n        {\n            // Write amount of REGISTRY_REDIRECTION_ENTRY64s\n            var result = BitConverter.GetBytes((ulong)NumberOfRegistryRedirectionEntries);\n\n            // Write REGISTRY_REDIRECTION_ENTRY64s\n            var entrys =\n                new byte[NumberOfRegistryRedirectionEntries * Marshal.SizeOf(new REGISTRY_REDIRECTION_ENTRY64())];\n            entrys.FillWith((byte)0x00);\n\n            for (var i = 0; i < _registryReplacement.Count; i++)\n            {\n                entrys.SetRange(ArrayExtensions.StructToBytes(_registryReplacement[i]),\n                                i * Marshal.SizeOf(_registryReplacement[i]));\n            }\n            result = result.CombineWith(entrys);\n\n            // Write data objects\n            result = result.CombineWith(_objectData.ToArray());\n\n            return result;\n        }\n\n        /// <summary>\n        ///     Add a fake registry item to runtime.\n        /// </summary>\n        internal bool AddRegistryEntry(\n            string root,\n            string subkey,\n            string valueName,\n            string dataType,\n            string data)\n        {\n            try\n            {\n                var original = new REGISTRY_ENTRY64\n                               {\n                                   Root = _regKeyFlags[root],\n                                   SubKey = new UNICODE_STRING64(),\n                                   ValueName = new UNICODE_STRING64(),\n                                   DataType = _regTypeFlags[dataType],\n                                   Data = 0,\n                                   DataSize = 0\n                               };\n\n                AddStringData(subkey,\n                              out original.SubKey.Buffer,\n                              out original.SubKey.Length,\n                              out original.SubKey.MaximumLength);\n\n                AddStringData(valueName,\n                              out original.ValueName.Buffer,\n                              out original.ValueName.Length,\n                              out original.ValueName.MaximumLength);\n\n                AddObjectData(dataType, data, out original.Data, out original.DataSize);\n\n                var entry = new REGISTRY_REDIRECTION_ENTRY64 {Original = original, Redirected = original};\n\n                _registryReplacement.Add(entry);\n\n                return true;\n            }\n            catch (Exception e)\n            {\n                MessageBox.Show(e.Message);\n\n                return false;\n            }\n        }\n\n        /// <summary>\n        ///     Append a string to the end of leb block\n        /// </summary>\n        private void AddStringData(string value, out long offset, out ushort length, out ushort maxLength)\n        {\n            ulong temp;\n            AddObjectData(\"REG_SZ\", value, out offset, out temp);\n\n            length = (ushort)temp;\n            maxLength = (ushort)temp;\n        }\n\n        /// <summary>\n        ///     Append a object to the end of leb block\n        /// </summary>\n        private void AddObjectData(string type, string value, out long offset, out ulong length)\n        {\n            offset = Marshal.SizeOf(new LoaderWrapper.LEB())\n                     + NumberOfRegistryRedirectionEntries * Marshal.SizeOf(new REGISTRY_REDIRECTION_ENTRY64())\n                     + _objectData.Count \n                     + sizeof (ulong) /*Size of NumberOfRegistryRedirectionEntries*/;\n\n            switch (type)\n            {\n                case \"REG_SZ\":\n                case \"REG_EXPAND_SZ\":\n                case \"REG_MULTI_SZ\":\n                    length = (ulong)Encoding.Unicode.GetBytes(value).Length;\n                    _objectData.AddRange(Encoding.Unicode.GetBytes(value));\n                    break;\n\n                case \"REG_DWORD\":\n                    length = sizeof (uint);\n                    _objectData.AddRange(BitConverter.GetBytes(uint.Parse(value)));\n                    break;\n\n                case \"REG_QWORD\":\n                    length = sizeof (ulong);\n                    _objectData.AddRange(BitConverter.GetBytes(ulong.Parse(value)));\n                    break;\n\n                case \"REG_BINARY\":\n                default:\n                    throw new Exception(\"Data type \" + type + \" not supported yet.\");\n            }\n\n            _objectData.AddRange(new byte[] {0x00, 0x00});\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct REGISTRY_ENTRY64\n        {\n            internal ulong Root;\n            internal UNICODE_STRING64 SubKey;\n            internal UNICODE_STRING64 ValueName;\n            internal uint DataType;\n            internal long Data;\n            internal ulong DataSize;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct REGISTRY_REDIRECTION_ENTRY64\n        {\n            internal REGISTRY_ENTRY64 Original;\n            internal REGISTRY_ENTRY64 Redirected;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct UNICODE_STRING64\n        {\n            internal ushort Length;\n            internal ushort MaximumLength;\n            internal long Buffer;\n        }\n    }\n}"
  },
  {
    "path": "LEProc/LEVersion.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LEVersion Version=\"2.5.0.0\" LastUpdate=\"20210823\" />"
  },
  {
    "path": "LEProc/LoaderWrapper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing Amemiya.Extensions;\nusing Microsoft.Win32;\n\nnamespace LEProc\n{\n    internal class LoaderWrapper\n    {\n        private const uint CREATE_NORMAL = 0x00000000;\n        private const uint CREATE_SUSPENDED = 0x00000004;\n        private byte[] _defaultFaceName = new byte[64];\n        private LEB _leb;\n        private LERegistryRedirector _registry = new LERegistryRedirector(0);\n\n        internal LoaderWrapper()\n            : this(null, null, null)\n        {\n        }\n\n        internal LoaderWrapper(string applicationName)\n            : this(applicationName, null, null)\n        {\n        }\n\n        internal LoaderWrapper(string applicationName, string commandLine, string currentDirectory)\n        {\n            ApplicationName = applicationName;\n            CommandLine = commandLine;\n            CurrentDirectory = currentDirectory;\n\n            _leb = new LEB\n                   {\n                       AnsiCodePage = 932,\n                       OemCodePage = 932,\n                       LocaleID = 0x411,\n                       DefaultCharset = 128,\n                       HookUILanguageAPI = 0,\n                       // As we have abandoned the \"default font\" parameter,\n                       // we decide to put here some empty bytes.\n                       DefaultFaceName = new byte[64]\n                   };\n            Timezone = \"Tokyo Standard Time\";\n        }\n\n        /// <summary>\n        ///     Application that will be run.\n        /// </summary>\n        internal string ApplicationName { get; set; }\n\n        /// <summary>\n        ///     Command arguments.\n        /// </summary>\n        internal string CommandLine { get; set; }\n\n        /// <summary>\n        ///     Working directory.\n        /// </summary>\n        internal string CurrentDirectory { get; set; }\n\n        /// <summary>\n        ///     Whether the process should be created with CREATE_SUSPENDED. Useful when debugging with OllyDbg.\n        /// </summary>\n        internal bool DebugMode { get; set; }\n\n        /// <summary>\n        ///     New AnsiCodePage. Default value is 932.\n        /// </summary>\n        internal uint AnsiCodePage\n        {\n            get { return _leb.AnsiCodePage; }\n            set { _leb.AnsiCodePage = value; }\n        }\n\n        /// <summary>\n        ///     New OemCodePage. Default value is 932.\n        /// </summary>\n        internal uint OemCodePage\n        {\n            get { return _leb.OemCodePage; }\n            set { _leb.OemCodePage = value; }\n        }\n\n        /// <summary>\n        ///     New LocaleID. Default value is 0x411(1041).\n        /// </summary>\n        internal uint LocaleID\n        {\n            get { return _leb.LocaleID; }\n            set { _leb.LocaleID = value; }\n        }\n\n        /// <summary>\n        ///     New DefaultCharset. Default value is 128(Shift-JIS).\n        /// </summary>\n        internal uint DefaultCharset\n        {\n            get { return _leb.DefaultCharset; }\n            set { _leb.DefaultCharset = value; }\n        }\n\n        /// <summary>\n        ///     Should we hook UI-related API? Default value is 0.\n        /// </summary>\n        internal uint HookUILanguageAPI\n        {\n            get { return _leb.HookUILanguageAPI; }\n            set { _leb.HookUILanguageAPI = value; }\n        }\n\n        /// <summary>\n        ///     String that represents a Timezone.\n        ///     This can be found in HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones.\n        /// </summary>\n        internal string Timezone\n        {\n            get { return _leb.Timezone.GetStandardName(); }\n            set\n            {\n                if (value.Length > 32)\n                    throw new Exception(\"String too long.\");\n\n                if (false == Enumerable.Any(TimeZoneInfo.GetSystemTimeZones(), item => item.Id == value))\n                    throw new Exception($\"Timezone \\\"{value}\\\" not found in your system.\");\n\n                var tzi = TimeZoneInfo.FindSystemTimeZoneById(value);\n                _leb.Timezone.SetStandardName(tzi.StandardName);\n                _leb.Timezone.SetDaylightName(tzi.StandardName);\n\n                var tzi2 = ReadTZIFromRegistry(value);\n                _leb.Timezone.Bias = tzi2.Bias;\n                _leb.Timezone.StandardBias = tzi2.StandardBias;\n                _leb.Timezone.DaylightBias = 0; //tzi2.DaylightBias;\n\n                //SYSTEMTIME is not the same with TIME_FIELDS (from RTL)\n                //_leb.Timezone.StandardDate = SYSTEMTIME_To_TIME_FIELDS(tzi2.StandardDate);\n                //_leb.Timezone.DaylightDate = SYSTEMTIME_To_TIME_FIELDS(tzi2.DaylightDate);\n            }\n        }\n\n        /// <summary>\n        ///     Get or set the number of registry redirection entries.\n        /// </summary>\n        internal int NumberOfRegistryRedirectionEntries\n        {\n            get { return _registry.NumberOfRegistryRedirectionEntries; }\n            set { _registry = new LERegistryRedirector(value); }\n        }\n\n        internal bool AddRegistryRedirectEntry(\n            string root,\n            string subkey,\n            string valueName,\n            string dataType,\n            string data)\n        {\n            return _registry.AddRegistryEntry(root,\n                                              subkey,\n                                              valueName,\n                                              dataType,\n                                              data);\n        }\n\n        /// <summary>\n        ///     Create process.\n        /// </summary>\n        /// <returns>Error number</returns>\n        internal uint Start()\n        {\n            if (string.IsNullOrEmpty(ApplicationName))\n                throw new Exception(\"ApplicationName cannot null.\");\n\n            var newLEB = ArrayExtensions.StructToBytes(_leb);\n            newLEB = newLEB.CombineWith(_registry.GetBinaryData());\n\n            var locLEB = Marshal.AllocHGlobal(newLEB.Length);\n            Marshal.Copy(newLEB, 0, locLEB, newLEB.Length);\n\n            AttachConsole(ATTACH_PARENT_PROCESS);\n\n            var startupInfo = new STARTUPINFO();\n            var processInformation = new PROCESS_INFORMATION();\n\n            var ret = LeCreateProcess(locLEB,\n                                   ApplicationName,\n                                   CommandLine,\n                                   CurrentDirectory,\n                                   DebugMode ? CREATE_SUSPENDED : CREATE_NORMAL,\n                                   ref startupInfo,\n                                   out processInformation,\n                                   IntPtr.Zero,\n                                   IntPtr.Zero,\n                                   IntPtr.Zero,\n                                   IntPtr.Zero);\n\n            Marshal.FreeHGlobal(locLEB);\n\n            if (ret == 0)\n            {\n                WaitForSingleObject(processInformation.hProcess, INFINITE);\n                CloseHandle(processInformation.hProcess);\n                CloseHandle(processInformation.hThread);\n            }\n\n            return ret;\n        }\n\n        private static byte[] SetBytes(byte[] bytesInput, IEnumerable<byte> bytesValue)\n        {\n            var i = 0;\n            foreach (var byteChar in bytesValue)\n            {\n                bytesInput[i] = byteChar;\n                i++;\n            }\n            return bytesInput;\n        }\n\n        public static T BytesToStruct<T>(byte[] bytes)\n        {\n            var size = Marshal.SizeOf(typeof (T));\n            var buffer = Marshal.AllocHGlobal(size);\n            try\n            {\n                Marshal.Copy(bytes, 0, buffer, size);\n                return (T)Marshal.PtrToStructure(buffer, typeof (T));\n            }\n            finally\n            {\n                Marshal.FreeHGlobal(buffer);\n            }\n        }\n\n        private TIME_FIELDS SYSTEMTIME_To_TIME_FIELDS(_SYSTEMTIME st)\n        {\n            return new TIME_FIELDS\n                   {\n                       Year = st.wYear,\n                       Month = st.wMonth,\n                       Day = st.wDay,\n                       Hour = st.wHour,\n                       Minute = st.wMinute,\n                       Second = st.wSecond,\n                       Milliseconds = st.wMilliseconds,\n                       Weekday = st.wDayOfWeek\n                   };\n        }\n\n        private _REG_TZI_FORMAT ReadTZIFromRegistry(string id)\n        {\n            var tzi =\n                (byte[])\n                Registry.GetValue(\n                                  $\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Time Zones\\\\{id}\",\n                                  \"TZI\",\n                                  null);\n\n            return BytesToStruct<_REG_TZI_FORMAT>(tzi);\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        public struct PROCESS_INFORMATION\n        {\n            public IntPtr hProcess;\n            public IntPtr hThread;\n            public uint dwProcessId;\n            public uint dwThreadId;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        public struct STARTUPINFO\n        {\n            public int cb;\n            public String lpReserved;\n            public String lpDesktop;\n            public String lpTitle;\n            public uint dwX;\n            public uint dwY;\n            public uint dwXSize;\n            public uint dwYSize;\n            public uint dwXCountChars;\n            public uint dwYCountChars;\n            public uint dwFillAttribute;\n            public uint dwFlags;\n            public short wShowWindow;\n            public short cbReserved2;\n            public IntPtr lpReserved2;\n            public IntPtr hStdInput;\n            public IntPtr hStdOutput;\n            public IntPtr hStdError;\n        }\n\n        [DllImport(\"LoaderDll.dll\", CharSet = CharSet.Unicode)]\n        public static extern uint LeCreateProcess(IntPtr leb,\n                                                  [MarshalAs(UnmanagedType.LPWStr), In] string applicationName,\n                                                  [MarshalAs(UnmanagedType.LPWStr), In] string commandLine,\n                                                  [MarshalAs(UnmanagedType.LPWStr), In] string currentDirectory,\n                                                  uint creationFlags,\n                                                  ref STARTUPINFO startupInfo,\n                                                  out PROCESS_INFORMATION processInformation,\n                                                  IntPtr processAttributes,\n                                                  IntPtr threadAttributes,\n                                                  IntPtr environment,\n                                                  IntPtr token);\n\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\n        static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);\n\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\n        static extern bool CloseHandle(IntPtr hHandle);\n\n        const uint INFINITE = 0xFFFFFFFF;\n\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\n        static extern bool AttachConsole(uint dwProcessId);\n\n        const uint ATTACH_PARENT_PROCESS = 0x0ffffffff;\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct LEB\n        {\n            internal uint AnsiCodePage;\n            internal uint OemCodePage;\n            internal uint LocaleID;\n            internal uint DefaultCharset;\n            internal uint HookUILanguageAPI;\n            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] internal byte[] DefaultFaceName;\n            internal RTL_TIME_ZONE_INFORMATION Timezone;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct PML_PROCESS_INFORMATION\n        {\n            internal IntPtr hProcess;\n            internal IntPtr hThread;\n            internal uint dwProcessId;\n            internal uint dwThreadId;\n            internal IntPtr FirstCallLdrLoadDll;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct RTL_TIME_ZONE_INFORMATION\n        {\n            internal int Bias;\n            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] internal byte[] StandardName;\n            internal TIME_FIELDS StandardDate;\n            internal int StandardBias;\n            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] internal byte[] DaylightName;\n            internal TIME_FIELDS DaylightDate;\n            internal int DaylightBias;\n\n            public override string ToString()\n            {\n                return\n                    $\"StandardName={Encoding.Unicode.GetString(StandardName)}\";\n            }\n\n            public string GetStandardName()\n            {\n                return Encoding.Unicode.GetString(StandardName).Replace(\"\\x00\", \"\");\n            }\n\n            public void SetStandardName(string name)\n            {\n                StandardName = SetBytes(new byte[64], Encoding.Unicode.GetBytes(name));\n            }\n\n            public string GetDaylightName()\n            {\n                return Encoding.Unicode.GetString(DaylightName).Replace(\"\\x00\", \"\");\n            }\n\n            public void SetDaylightName(string name)\n            {\n                DaylightName = SetBytes(new byte[64], Encoding.Unicode.GetBytes(name));\n            }\n        }\n\n        private struct _REG_TZI_FORMAT\n        {\n            internal int Bias;\n            internal int StandardBias;\n            internal int DaylightBias;\n            internal _SYSTEMTIME StandardDate;\n            internal _SYSTEMTIME DaylightDate;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct _SYSTEMTIME\n        {\n            internal ushort wYear;\n            internal ushort wMonth;\n            internal ushort wDayOfWeek;\n            internal ushort wDay;\n            internal ushort wHour;\n            internal ushort wMinute;\n            internal ushort wSecond;\n            internal ushort wMilliseconds;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        internal struct TIME_FIELDS\n        {\n            internal ushort Year; // range [1601...]\n            internal ushort Month; // range [1..12]\n            internal ushort Day; // range [1..31]\n            internal ushort Hour; // range [0..23]\n            internal ushort Minute; // range [0..59]\n            internal ushort Second; // range [0..59]\n            internal ushort Milliseconds; // range [0..999]\n            internal ushort Weekday; // range [0..6] == [Sunday..Saturday]\n        }\n    }\n}\n"
  },
  {
    "path": "LEProc/Program.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Windows.Forms;\nusing LECommonLibrary;\n\nnamespace LEProc\n{\n    internal static class Program\n    {\n        internal static string[] Args;\n\n        /// <summary>\n        ///     The main entry point for the application.\n        /// </summary>\n        [STAThread]\n        private static void Main(string[] args)\n        {\n            SystemHelper.DisableDPIScale();\n\n            try\n            {\n                Process.Start(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                        \"LEUpdater.exe\"),\n                    \"schedule\");\n            }\n            catch\n            {\n            }\n\n            if (!GlobalHelper.CheckCoreDLLs())\n            {\n                MessageBox.Show(\n                    \"Some of the core Dlls are missing.\\r\\n\" +\n                    \"Please whitelist these Dlls in your antivirus software, then download and re-install LE.\\r\\n\"\n                    +\n                    \"\\r\\n\" +\n                    \"These Dlls are:\\r\\n\" +\n                    \"LoaderDll.dll\\r\\n\" +\n                    \"LocaleEmulator.dll\",\n                    \"Locale Emulator Version \" + GlobalHelper.GetLEVersion(),\n                    MessageBoxButtons.OK,\n                    MessageBoxIcon.Error);\n\n                return;\n            }\n            \n            //If global config does not exist, create a new one.\n            LEConfig.CheckGlobalConfigFile(true);\n\n            if (args.Length == 0)\n            {\n                MessageBox.Show(\n                    \"Welcome to Locale Emulator command line tool.\\r\\n\" +\n                    \"\\r\\n\" +\n                    \"Usage: LEProc.exe\\r\\n\" +\n                    \"\\tpath\\r\\n\" +\n                    \"\\t-run path [args]\\r\\n\" +\n                    \"\\t-runas guid path [args]\\r\\n\" +\n                    \"\\t-manage path\\r\\n\" +\n                    \"\\t-global\\r\\n\" +\n                    \"\\r\\n\" +\n                    \"path\\tFull path of the target application.\\r\\n\" +\n                    \"guid\\tGuid of the target profile (in LEConfig.xml).\\r\\n\" +\n                    \"args\\tAdditional arguments will be passed to the application.\\r\\n\" +\n                    \"\\r\\n\" +\n                    \"path\\tRun an application with \\r\\n\" +\n                    \"\\t\\t(i) its own profile (if any) or \\r\\n\" +\n                    \"\\t\\t(ii) first global profile (if any) or \\r\\n\" +\n                    \"\\t\\t(iii) default ja-JP profile.\\r\\n\" +\n                    \"-run\\tRun an application with it's own profile.\\r\\n\" +\n                    \"-runas\\tRun an application with a global profile of specific Guid.\\r\\n\" +\n                    \"-manage\\tModify the profile of one application.\\r\\n\" +\n                    \"-global\\tOpen Global Profile Manager.\\r\\n\" +\n                    \"\\r\\n\" +\n                    \"\\r\\n\" +\n                    \"You can press CTRL+C to copy this message to your clipboard.\\r\\n\",\n                    \"Locale Emulator Version \" + GlobalHelper.GetLEVersion()\n                );\n\n                GlobalHelper.ShowErrorDebugMessageBox(\"SYSTEM_REPORT\", 0);\n\n                return;\n            }\n\n            try\n            {\n                Args = args;\n\n                switch (Args[0])\n                {\n                    case \"-run\": //-run %APP%\n                        RunWithIndependentProfile(Args[1]);\n                        break;\n\n                    case \"-manage\": //-manage %APP%\n                        Process.Start(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                                \"LEGUI.exe\"),\n                            $\"\\\"{Args[1]}.le.config\\\"\");\n                        break;\n\n                    case \"-global\": //-global\n                        Process.Start(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),\n                            \"LEGUI.exe\"));\n                        break;\n\n                    case \"-runas\": //-runas %GUID% %APP%\n                        RunWithGlobalProfile(Args[1], Args[2]);\n                        break;\n\n                    default:\n                        if (File.Exists(Args[0]))\n                        {\n                            RunWithDefaultProfile(Args[0]);\n                        }\n                        break;\n                }\n            }\n            catch\n            {\n            }\n        }\n\n        private static void RunWithDefaultProfile(string path)\n        {\n            path = SystemHelper.EnsureAbsolutePath(path);\n\n            var conf = path + \".le.config\";\n\n            var appProfile = LEConfig.GetProfiles(conf);\n            var globalProfiles = LEConfig.GetProfiles();\n\n            // app profile > first global profile > new profile(ja-JP)\n            var profile = appProfile.Any()\n                ? appProfile.First()\n                : globalProfiles.Any() ? globalProfiles.First() : new LEProfile(true);\n\n            DoRunWithLEProfile(path, 1, profile);\n        }\n\n        private static void RunWithGlobalProfile(string guid, string path)\n        {\n            path = SystemHelper.EnsureAbsolutePath(path);\n\n            // We do not check whether the config exists because only when it exists can this method be called.\n\n            var profile = LEConfig.GetProfiles().First(p => p.Guid == guid);\n\n            DoRunWithLEProfile(path, 3, profile);\n        }\n\n        private static void RunWithIndependentProfile(string path)\n        {\n            path = SystemHelper.EnsureAbsolutePath(path);\n\n            var conf = path + \".le.config\";\n\n            if (!File.Exists(conf))\n            {\n                Process.Start(\n                    Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), \"LEGUI.exe\"),\n                    $\"\\\"{path}.le.config\\\"\");\n            }\n            else\n            {\n                var profile = LEConfig.GetProfiles(conf)[0];\n                DoRunWithLEProfile(path, 2, profile);\n            }\n        }\n\n        private static void DoRunWithLEProfile(string absPath, int argumentsStart, LEProfile profile)\n        {\n            try\n            {\n                if (profile.RunAsAdmin && !SystemHelper.IsAdministrator())\n                {\n                    ElevateProcess();\n\n                    return;\n                }\n\n                if (profile.RunWithSuspend)\n                {\n                    if (DialogResult.No ==\n                        MessageBox.Show(\n                            \"You are running a exectuable with CREATE_SUSPENDED flag.\\r\\n\" +\n                            \"\\r\\n\" +\n                            \"The exectuable will be executed after you click the \\\"Yes\\\" button, \" +\n                            \"but as a background process which has no notifications at all.\" +\n                            \"You can attach it by using OllyDbg, or stop it with Task Manager.\\r\\n\",\n                            \"Locale Emulator Debug Mode Warning\",\n                            MessageBoxButtons.YesNo,\n                            MessageBoxIcon.Information\n                            ))\n                        return;\n                }\n\n                var applicationName = string.Empty;\n                var commandLine = string.Empty;\n\n                if (Path.GetExtension(absPath).ToLower() == \".exe\")\n                {\n                    applicationName = absPath;\n\n                    commandLine = absPath.StartsWith(\"\\\"\")\n                        ? $\"{absPath} \"\n                        : $\"\\\"{absPath}\\\" \";\n\n                    // use arguments in le.config, prior to command line arguments\n                    commandLine += string.IsNullOrEmpty(profile.Parameter) && Args.Skip(argumentsStart).Any()\n                        ? Args.Skip(argumentsStart).Aggregate((a, b) => $\"{a} {b}\")\n                        : profile.Parameter;\n                }\n                else\n                {\n                    var jb = AssociationReader.GetAssociatedProgram(Path.GetExtension(absPath));\n\n                    if (jb == null)\n                        return;\n\n                    applicationName = jb[0];\n\n                    commandLine = jb[0].StartsWith(\"\\\"\")\n                        ? $\"{jb[0]} \"\n                        : $\"\\\"{jb[0]}\\\" \";\n                    commandLine += jb[1].Replace(\"%1\", absPath).Replace(\"%*\", profile.Parameter);\n                }\n\n                var currentDirectory = Path.GetDirectoryName(absPath);\n                var ansiCodePage = (uint) CultureInfo.GetCultureInfo(profile.Location).TextInfo.ANSICodePage;\n                var oemCodePage = (uint) CultureInfo.GetCultureInfo(profile.Location).TextInfo.OEMCodePage;\n                var localeID = (uint) CultureInfo.GetCultureInfo(profile.Location).TextInfo.LCID;\n                var defaultCharset = (uint)\n                    GetCharsetFromANSICodepage(CultureInfo.GetCultureInfo(profile.Location)\n                        .TextInfo.ANSICodePage);\n\n                var registries = profile.RedirectRegistry\n                    ? RegistryEntriesLoader.GetRegistryEntries(profile.IsAdvancedRedirection)\n                    : null;\n\n                var l = new LoaderWrapper\n                {\n                    ApplicationName = applicationName,\n                    CommandLine = commandLine,\n                    CurrentDirectory = currentDirectory,\n                    AnsiCodePage = ansiCodePage,\n                    OemCodePage = oemCodePage,\n                    LocaleID = localeID,\n                    DefaultCharset = defaultCharset,\n                    HookUILanguageAPI = profile.IsAdvancedRedirection ? (uint) 1 : 0,\n                    Timezone = profile.Timezone,\n                    NumberOfRegistryRedirectionEntries = registries?.Length ?? 0,\n                    DebugMode = profile.RunWithSuspend\n                };\n\n                registries?.ToList()\n                    .ForEach(\n                        item =>\n                            l.AddRegistryRedirectEntry(item.Root,\n                                item.Key,\n                                item.Name,\n                                item.Type,\n                                item.GetValue(CultureInfo.GetCultureInfo(profile.Location))));\n\n                uint ret;\n                if ((ret = l.Start()) != 0)\n                {\n                    if (SystemHelper.IsAdministrator())\n                    {\n                        GlobalHelper.ShowErrorDebugMessageBox(commandLine, ret);\n                    }\n                    else\n                    {\n                        ElevateProcess();\n                    }\n                }\n            }\n            catch (Exception e)\n            {\n                MessageBox.Show(e.ToString());\n            }\n        }\n\n        private static void ElevateProcess()\n        {\n            try\n            {\n                SystemHelper.RunWithElevatedProcess(\n                    Path.Combine(\n                        Path.GetDirectoryName(\n                            Assembly.GetExecutingAssembly()\n                                .Location),\n                        \"LEProc.exe\"),\n                    Args);\n            }\n            catch (Exception)\n            {\n            }\n        }\n\n        private static int GetCharsetFromANSICodepage(int ansicp)\n        {\n            const int ANSI_CHARSET = 0;\n            const int DEFAULT_CHARSET = 1;\n            const int SYMBOL_CHARSET = 2;\n            const int SHIFTJIS_CHARSET = 128;\n            const int HANGEUL_CHARSET = 129;\n            const int HANGUL_CHARSET = 129;\n            const int GB2312_CHARSET = 134;\n            const int CHINESEBIG5_CHARSET = 136;\n            const int OEM_CHARSET = 255;\n            const int JOHAB_CHARSET = 130;\n            const int HEBREW_CHARSET = 177;\n            const int ARABIC_CHARSET = 178;\n            const int GREEK_CHARSET = 161;\n            const int TURKISH_CHARSET = 162;\n            const int VIETNAMESE_CHARSET = 163;\n            const int THAI_CHARSET = 222;\n            const int EASTEUROPE_CHARSET = 238;\n            const int RUSSIAN_CHARSET = 204;\n            const int MAC_CHARSET = 77;\n            const int BALTIC_CHARSET = 186;\n\n            var charset = ANSI_CHARSET;\n\n            switch (ansicp)\n            {\n                case 932: // Japanese\n                    charset = SHIFTJIS_CHARSET;\n                    break;\n                case 936: // Simplified Chinese\n                    charset = GB2312_CHARSET;\n                    break;\n                case 949: // Korean\n                    charset = HANGEUL_CHARSET;\n                    break;\n                case 950: // Traditional Chinese\n                    charset = CHINESEBIG5_CHARSET;\n                    break;\n                case 1250: // Eastern Europe\n                    charset = EASTEUROPE_CHARSET;\n                    break;\n                case 1251: // Russian\n                    charset = RUSSIAN_CHARSET;\n                    break;\n                case 1252: // Western European Languages\n                    charset = ANSI_CHARSET;\n                    break;\n                case 1253: // Greek\n                    charset = GREEK_CHARSET;\n                    break;\n                case 1254: // Turkish\n                    charset = TURKISH_CHARSET;\n                    break;\n                case 1255: // Hebrew\n                    charset = HEBREW_CHARSET;\n                    break;\n                case 1256: // Arabic\n                    charset = ARABIC_CHARSET;\n                    break;\n                case 1257: // Baltic\n                    charset = BALTIC_CHARSET;\n                    break;\n            }\n\n            return charset;\n        }\n    }\n}\n"
  },
  {
    "path": "LEProc/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"LEProc\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Paddy Xu\")]\n[assembly: AssemblyProduct(\"LEProc\")]\n[assembly: AssemblyCopyright(\"Copyright © Paddy Xu 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"2087a15c-bf38-4bac-a5cd-c0b2e5d4abde\")]"
  },
  {
    "path": "LEProc/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34003\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEProc.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"LEProc.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEProc/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "LEProc/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34003\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEProc.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEProc/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "LEProc/RegistryEntriesLoader.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing LECommonLibrary;\nusing System.Globalization;\n\nnamespace LEProc\n{\n    public static class RegistryEntriesLoader\n    {\n        private static readonly RegistryEntry[] entries;\n        private static readonly RegistryEntry[] entriesIncludingAdvanced;\n\n        static RegistryEntriesLoader()\n        {\n            entries = new[]\n            {\n                new RegistryEntry(\"HKEY_LOCAL_MACHINE\", @\"System\\CurrentControlSet\\Control\\Nls\\CodePage\", \"InstallLanguage\", \"REG_SZ\", culture => culture.TextInfo.LCID.ToString()),\n                new RegistryEntry(\"HKEY_LOCAL_MACHINE\", @\"System\\CurrentControlSet\\Control\\Nls\\CodePage\", \"Default\", \"REG_SZ\", culture => culture.TextInfo.LCID.ToString()),\n                new RegistryEntry(\"HKEY_LOCAL_MACHINE\", @\"System\\CurrentControlSet\\Control\\Nls\\CodePage\", \"OEMCP\", \"REG_SZ\", culture => culture.TextInfo.OEMCodePage.ToString()),\n                new RegistryEntry(\"HKEY_LOCAL_MACHINE\", @\"System\\CurrentControlSet\\Control\\Nls\\CodePage\", \"ACP\", \"REG_SZ\", culture => culture.TextInfo.ANSICodePage.ToString())\n\n            };\n\n            var advancedEntries = new[]\n            {\n                new RegistryEntry(\"HKEY_CURRENT_USER\", @\"Control Panel\\International\", \"Locale\", \"REG_SZ\", culture => culture.TextInfo.LCID.ToString(\"X8\")),\n                new RegistryEntry(\"HKEY_CURRENT_USER\", @\"Control Panel\\International\", \"LocaleName\", \"REG_SZ\", culture => $\"{culture.TextInfo.CultureName}\\x00\"),\n                new RegistryEntry(\"HKEY_CURRENT_USER\", @\"Control Panel\\Desktop\", \"PreferredUILanguages\", \"REG_MULTI_SZ\", culture => $\"{culture.TextInfo.CultureName}\\x00\"),\n                new RegistryEntry(\"HKEY_CURRENT_USER\", @\"Control Panel\\Desktop\\MuiCached\", \"MachinePreferredUILanguages\", \"REG_MULTI_SZ\", culture => $\"{culture.TextInfo.CultureName}\\x00\")\n            };\n\n            entriesIncludingAdvanced = entries.Concat(advancedEntries).ToArray();\n        }\n\n        public static RegistryEntry[] GetRegistryEntries(bool isAdvanced)\n        {\n            return isAdvanced ? entriesIncludingAdvanced : entries;\n        }\n\n\n    }\n}"
  },
  {
    "path": "LEProc/RegistryEntry.cs",
    "content": "﻿using System.Globalization;\n\nnamespace LEProc\n{\n    public class RegistryEntry\n    {\n\n        public delegate string ValueReceiver(CultureInfo culture);\n\n        /// <summary>\n        /// e.g. HKEY_LOCAL_MACHINE\n        /// </summary>\n        public string Root { get; private set; }\n\n        /// <summary>\n        /// e.g. System\\CurrentControlSet\\Control\\Nls\\CodePage\n        /// </summary>\n        public string Key { get; private set; }\n\n        /// <summary>\n        /// e.g. ACP\n        /// </summary>\n        public string Name { get; private set; }\n\n        /// <summary>\n        /// e.g. REG_SZ\n        /// </summary>\n        public string Type { get; private set; }\n\n        /// <summary>\n        /// e.g. culture => culture.TextInfo.ANSICodePage.ToString()\n        /// In the example above, if the culture corresponds to ja-jp, the result is \"932\".\n        /// </summary>\n        public ValueReceiver GetValue { get; private set; }\n\n        public RegistryEntry(string root, string key, string name, string type, ValueReceiver getValue)\n        {\n            Root = root;\n            Key = key;\n            Name = name;\n            Type = type;\n            GetValue = getValue;\n        }\n    }\n}"
  },
  {
    "path": "LEProc/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<asmv1:assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv1=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"MyApplication.app\"/>\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n    <security>\n      <requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <!-- UAC Manifest Options\n            If you want to change the Windows User Account Control level replace the \n            requestedExecutionLevel node with one of the following.\n\n        <requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n            Specifying requestedExecutionLevel node will disable file and registry virtualization.\n            If you want to utilize File and Registry Virtualization for backward \n            compatibility then delete the requestedExecutionLevel node.\n        -->\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!-- A list of all Windows versions that this application is designed to work with. \n      Windows will automatically select the most compatible environment.-->\n\n      <!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->\n      <!--<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"></supportedOS>-->\n\n      <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->\n      <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n\n      <!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->\n      <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"></supportedOS>\n\n      <!-- Windows 10 -->\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n      \n    </application>\n  </compatibility>\n\n  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n  <!-- <dependency>\n    <dependentAssembly>\n      <assemblyIdentity\n          type=\"win32\"\n          name=\"Microsoft.Windows.Common-Controls\"\n          version=\"6.0.0.0\"\n          processorArchitecture=\"*\"\n          publicKeyToken=\"6595b64144ccf1df\"\n          language=\"*\"\n        />\n    </dependentAssembly>\n  </dependency>-->\n\n</asmv1:assembly>\n"
  },
  {
    "path": "LEUpdater/Amemiya.Net.WebClientEx.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Net;\n\nnamespace Amemiya.Net\n{\n    public class WebClientEx : WebClient\n    {\n        public WebClientEx() : this(60 * 1000)\n        {\n        }\n\n        public WebClientEx(int timeout)\n        {\n            Timeout = timeout;\n        }\n\n        public int Timeout { get; set; }\n\n        protected override WebRequest GetWebRequest(Uri address)\n        {\n            var request = base.GetWebRequest(address);\n\n            request.Timeout = Timeout;\n\n            return request;\n        }\n\n        public MemoryStream DownloadDataStream(string address)\n        {\n            var buffer = DownloadData(address);\n\n            return new MemoryStream(buffer);\n        }\n\n        public MemoryStream DownloadDataStream(Uri address)\n        {\n            var buffer = DownloadData(address);\n\n            return new MemoryStream(buffer);\n        }\n    }\n}"
  },
  {
    "path": "LEUpdater/ApplicationUpdater.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Windows.Forms;\nusing System.Xml;\nusing Amemiya.Net;\nusing LECommonLibrary;\n\nnamespace LEUpdater\n{\n    internal static class ApplicationUpdater\n    {\n        private static string url = string.Empty;\n\n        internal static void CheckApplicationUpdate(string version, NotifyIcon notifyIcon)\n        {\n            var url = @\"http://xupefei.github.io/Locale-Emulator/VersionInfo.xml\";\n\n            try\n            {\n                var client = new WebClientEx(10 * 1000);\n                var stream = client.DownloadDataStream(url);\n\n                var xmlContent = new XmlDocument();\n                xmlContent.Load(stream);\n\n                ProcessUpdate(xmlContent, notifyIcon);\n            }\n            catch (Exception)\n            {\n                notifyIcon.Visible = false;\n                Environment.Exit(0);\n            }\n        }\n\n        private static void ProcessUpdate(XmlDocument xmlContent, NotifyIcon notifyIcon)\n        {\n            var newVer = xmlContent.SelectSingleNode(@\"/VersionInfo/Version/text()\").Value;\n            var crtVer = GlobalHelper.GetLEVersion();\n            \n            GlobalHelper.SetLastUpdate(int.Parse(DateTime.Now.ToString(\"yyyyMMdd\")));\n            \n            if (CompareVersion(crtVer, newVer))\n            {\n                try\n                {\n                    var version = xmlContent.SelectSingleNode(@\"/VersionInfo/Version/text()\").Value;\n                    var date = xmlContent.SelectSingleNode(@\"/VersionInfo/Date/text()\").Value;\n                    url = xmlContent.SelectSingleNode(@\"/VersionInfo/Url/text()\").Value;\n                    var note = xmlContent.SelectSingleNode(@\"/VersionInfo/Note/text()\").Value;\n\n                    notifyIcon.BalloonTipClicked += (sender, e) =>\n                                                    {\n                                                        Process.Start(url);\n\n                                                        notifyIcon.Visible = false;\n                                                        Environment.Exit(0);\n                                                    };\n                    notifyIcon.BalloonTipClosed += (sender, e) =>\n                                                   {\n                                                       notifyIcon.Visible = false;\n                                                       Environment.Exit(0);\n                                                   };\n\n                    notifyIcon.ShowBalloonTip(0,\n                                              $\"New Version {version} Available (Current: {GlobalHelper.GetLEVersion()})\",\n                                              $\"{note}\\r\\n\" + \"\\r\\n\" + \"Click here to open download page.\",\n                                              ToolTipIcon.Info);\n\n                    notifyIcon.Text = $\"New Version {version} Available.\";\n                }\n                catch (Exception)\n                {\n                    notifyIcon.Visible = false;\n                    Environment.Exit(0);\n                }\n            }\n            else\n            {\n                notifyIcon.Visible = false;\n                Environment.Exit(0);\n            }\n        }\n\n        /// <summary>\n        ///     If newVer is bigger than oldVer, return true.\n        /// </summary>\n        /// <param name=\"oldVer\"></param>\n        /// <param name=\"newVer\"></param>\n        /// <returns></returns>\n        private static bool CompareVersion(string oldVer, string newVer)\n        {\n            var versionOld = new Version(oldVer);\n            var versionNew = new Version(newVer);\n\n            return versionOld < versionNew;\n        }\n    }\n}"
  },
  {
    "path": "LEUpdater/LEUpdater.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{A0011409-0A25-4E95-BF6D-EE7CB9C287DA}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>LEUpdater</RootNamespace>\n    <AssemblyName>LEUpdater</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile>Client</TargetFrameworkProfile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\Build\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\Build\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup>\n    <SignAssembly>true</SignAssembly>\n  </PropertyGroup>\n  <PropertyGroup>\n    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>icon.ico</ApplicationIcon>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Deployment\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Amemiya.Net.WebClientEx.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"ApplicationUpdater.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"app.config\" />\n    <None Include=\"key.snk\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\LECommonLibrary\\LECommonLibrary.csproj\">\n      <Project>{c4def32b-8fbb-41b6-80dc-c60339402323}</Project>\n      <Name>LECommonLibrary</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"icon.ico\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "LEUpdater/Program.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Reflection;\nusing System.Windows.Forms;\nusing LECommonLibrary;\nusing LEUpdater.Properties;\n\nnamespace LEUpdater\n{\n    internal static class Program\n    {\n        private static readonly NotifyIcon _notifyIcon = new NotifyIcon {Icon = Resources.icon};\n        private static bool auto;\n\n        private static void Main(string[] args)\n        {\n            auto = args.Length != 0;\n\n            // Check new version every week.\n            if (auto && int.Parse(DateTime.Now.ToString(\"yyyyMMdd\")) - GlobalHelper.GetLastUpdate() < 7)\n            {\n                Environment.Exit(0);\n            }\n\n            if (!SystemHelper.CheckPermission(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)))\n            {\n                if (!SystemHelper.IsAdministrator())\n                {\n                    SystemHelper.RunWithElevatedProcess(\n                                                        Path.Combine(Assembly.GetExecutingAssembly().Location),\n                                                        args);\n\n                    Environment.Exit(0);\n                }\n                else\n                {\n                    _notifyIcon.Visible = false;\n                    Environment.Exit(0);\n                }\n            }\n\n            CheckUpdates(GlobalHelper.GetLEVersion());\n        }\n\n        private static void CheckUpdates(string appVer)\n        {\n            _notifyIcon.Visible = true;\n\n            _notifyIcon.DoubleClick += (sender, e) =>\n                                       {\n                                           _notifyIcon.Visible = false;\n                                           Environment.Exit(0);\n                                       };\n\n            ApplicationUpdater.CheckApplicationUpdate(appVer, _notifyIcon);\n\n            Application.Run();\n        }\n    }\n}"
  },
  {
    "path": "LEUpdater/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"LEUpdater\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Paddy Xu\")]\n[assembly: AssemblyProduct(\"LEUpdater\")]\n[assembly: AssemblyCopyright(\"Copyright © Paddy Xu 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"0bae7b36-1202-460d-8ee3-61d2aa98cf6a\")]"
  },
  {
    "path": "LEUpdater/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34014\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEUpdater.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"LEUpdater.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized resource of type System.Drawing.Icon similar to (Icon).\n        /// </summary>\n        internal static System.Drawing.Icon icon {\n            get {\n                object obj = ResourceManager.GetObject(\"icon\", resourceCulture);\n                return ((System.Drawing.Icon)(obj));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEUpdater/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n  <data name=\"icon\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n    <value>..\\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n  </data>\n</root>"
  },
  {
    "path": "LEUpdater/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34011\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace LEUpdater.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "LEUpdater/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "LEUpdater/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<configuration>\n  <startup>\n    <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.0,Profile=Client\" />\n  </startup>\n</configuration>"
  },
  {
    "path": "LocaleEmulator.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.26430.14\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"LEContextMenuHandler\", \"LEContextMenuHandler\\LEContextMenuHandler.csproj\", \"{0041073D-2FA7-4B35-B904-9C606C89C8CD}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"LEProc\", \"LEProc\\LEProc.csproj\", \"{A2CF5369-4665-49F6-B948-B44296002C3D}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"LEGUI\", \"LEGUI\\LEGUI.csproj\", \"{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"LECommonLibrary\", \"LECommonLibrary\\LECommonLibrary.csproj\", \"{C4DEF32B-8FBB-41B6-80DC-C60339402323}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"LEInstaller\", \"LEInstaller\\LEInstaller.csproj\", \"{E218923D-59A4-4FA5-B4BC-E540290DA3F8}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{A0011409-0A25-4E95-BF6D-EE7CB9C287DA} = {A0011409-0A25-4E95-BF6D-EE7CB9C287DA}\n\t\t{C4DEF32B-8FBB-41B6-80DC-C60339402323} = {C4DEF32B-8FBB-41B6-80DC-C60339402323}\n\t\t{0041073D-2FA7-4B35-B904-9C606C89C8CD} = {0041073D-2FA7-4B35-B904-9C606C89C8CD}\n\t\t{A2CF5369-4665-49F6-B948-B44296002C3D} = {A2CF5369-4665-49F6-B948-B44296002C3D}\n\t\t{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C} = {33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"LEUpdater\", \"LEUpdater\\LEUpdater.csproj\", \"{A0011409-0A25-4E95-BF6D-EE7CB9C287DA}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{0041073D-2FA7-4B35-B904-9C606C89C8CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0041073D-2FA7-4B35-B904-9C606C89C8CD}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0041073D-2FA7-4B35-B904-9C606C89C8CD}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0041073D-2FA7-4B35-B904-9C606C89C8CD}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A2CF5369-4665-49F6-B948-B44296002C3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A2CF5369-4665-49F6-B948-B44296002C3D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A2CF5369-4665-49F6-B948-B44296002C3D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A2CF5369-4665-49F6-B948-B44296002C3D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{33B8F5CA-34A7-4826-BAD9-7CEC63DF4D0C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C4DEF32B-8FBB-41B6-80DC-C60339402323}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C4DEF32B-8FBB-41B6-80DC-C60339402323}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C4DEF32B-8FBB-41B6-80DC-C60339402323}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C4DEF32B-8FBB-41B6-80DC-C60339402323}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E218923D-59A4-4FA5-B4BC-E540290DA3F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E218923D-59A4-4FA5-B4BC-E540290DA3F8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E218923D-59A4-4FA5-B4BC-E540290DA3F8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E218923D-59A4-4FA5-B4BC-E540290DA3F8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A0011409-0A25-4E95-BF6D-EE7CB9C287DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A0011409-0A25-4E95-BF6D-EE7CB9C287DA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A0011409-0A25-4E95-BF6D-EE7CB9C287DA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A0011409-0A25-4E95-BF6D-EE7CB9C287DA}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "README.md",
    "content": "Locale Emulator\n===============\n\n[![license](https://img.shields.io/github/license/xupefei/Locale-Emulator.svg)](https://www.gnu.org/licenses/lgpl-3.0.en.html)\n[![AppVeyor](https://img.shields.io/appveyor/ci/xupefei/Locale-Emulator.svg)](https://ci.appveyor.com/project/xupefei/Locale-Emulator)\n[![Github All Releases](https://img.shields.io/github/downloads/xupefei/Locale-Emulator/total.svg)](https://github.com/xupefei/Locale-Emulator/releases)\n[![GitHub release](https://img.shields.io/github/release/xupefei/Locale-Emulator.svg)](https://github.com/xupefei/Locale-Emulator/releases/latest)\n\nYet Another System Region and Language Simulator\n\n![LE interface](https://i.imgur.com/E4Gqyly.png)\n\n## Download ##\n\nDownload available at <https://github.com/xupefei/Locale-Emulator/releases>.\n\nFor usage, please read <https://xupefei.github.io/Locale-Emulator/> (in English and 中文).\n\n## Translate ##\n\nIf you want to help translating Locale Emulator, you can find all strings in\n\n -  `DefaultLanguage.xaml` in `LEGUI/Lang` folder.\n -  `DefaultLanguage.xml` in `LEContextMenuHandler/Lang` folder.\n\nAfter you translated the above files into your language, please inform me by creating a pull request.\n\n## Build ##\n\n 1. Clone the repo using Git.\n 2. Install Microsoft Visual Studio 2015 / 2017.\n 3. Open `LocaleEmulator.sln`.\n 4. Perform Build action.\n 5. Clone and build the core libraries: https://github.com/xupefei/Locale-Emulator-Core\n 6. Copy LoaderDll.dll and LocaleEmulator.dll from Locale-Emulator-Core to Locale-Emulator build folder.\n\n## License ##\n\n![LGPL](https://www.gnu.org/graphics/lgplv3-147x51.png)\n\n`LEContextMenuHandler` project use source codes from [Microsoft All-In-One Code Framework](https://blogs.msdn.com/b/onecode/) which is licensed by [Microsoft Public License](https://www.microsoft.com/en-us/openness/licenses.aspx#MPL).\n\n[Flat icon set](commit/eae9fbc27f1a4c85986577202b61742c6287e10a) from [graphicex](https://graphicex.com/icon-and-logo/15983-flat-alphabet-in-9-colors-with-long-shadow-6913875.html).\n\nAll other source code files are licensed under [LGPL-3.0](https://opensource.org/licenses/LGPL-3.0).\n\nIf you want make any modification on these source codes while keeping new codes not protected by LGPL-3.0, please contact me for a sublicense instead.\n"
  },
  {
    "path": "Scripts/sign-package.ps1",
    "content": "﻿if(-not (Test-Path env:CI))\n{\n    $signExe = 'C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.16299.0\\x86\\signtool.exe'\n    $files = gci '..\\Build\\Release\\*' -Recurse -Include *.exe,LoaderDll.dll,LocaleEmulator.dll | %{('\"{0}\"' -f $_.FullName)}\n    $timestampUrl = 'http://time.certum.pl/'\n\n    .$signExe sign /a /v /fd sha256 /t $timestampUrl $files\n}"
  }
]