Пример #1
0
        // update a string key to a new key name
        public static void UpdateStringKey(string oldKey, string newKey)
        {
            Ensurer.EnsureEverything();

            updateStringKey(oldKey, newKey, string.Empty);
            foreach (var locale in GetStringsResLocales())
            {
                updateStringKey(oldKey, newKey, locale);
            }

            var oldCs   = GetStringCall(oldKey, false);
            var oldXaml = GetStringCall(oldKey, true);
            var newCs   = GetStringCall(newKey, false);
            var newXaml = GetStringCall(newKey, true);

            foreach (var file in VsUtils.GetProjectFiles(VsUtils.GetCurrentProject()))
            {
                if (file.EndsWith(extensionCs))
                {
                    updateSource(file, oldCs, newCs);
                }

                else if (file.EndsWith(extensionXaml))
                {
                    updateSource(file, oldXaml, newXaml);
                }
            }
        }