Esempio n. 1
0
        private void deleteKey(bool translationsOnly)
        {
            if (info != null)
            {
                AndroidXmlChecker checker = new AndroidXmlChecker();
                checker.FolderName = Properties.Settings.Default.ValuesFolder;
                string stringId = tbxDeleteKey.Text;

                if (info.Summary.Exists(d => d.StringId == stringId))
                {
                    AndroidXmlChecker.StringData    stringData    = info.Summary.Find(d => d.StringId == stringId);
                    AndroidXmlChecker.DeleteKeyInfo deleteKeyInfo = checker.DeleteKey(stringData, translationsOnly, progressBar);
                    if (deleteKeyInfo.Error != null)
                    {
                        MessageBox.Show(
                            "Delete Key: " + stringId + "\r\n" +
                            "Delete count: " + deleteKeyInfo.Count + "\r\n" +
                            "Error: " + deleteKeyInfo.Error.ToString(),
                            "Delete Key Error",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show(
                            "Delete Key: " + stringId + "\r\n" +
                            "Delete count: " + deleteKeyInfo.Count,
                            "Delete Key Success",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show(
                        "Delete Key: " + stringId + "\r\n" +
                        "String id not found.",
                        "Delete Key Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(
                    "Please run first the \"Check Android xml files\" option.",
                    "Delete Key Warning",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning);
            }
        }