private void ActionSave() { bool result; // надо скопировать данные из EditorDataModel.Items в новый ResourcesDictionary // need to copy data from EditorDataModel.Items to new ResourcesDictionary ResourceDictionary newResourceDictionary = new ResourceDictionary(); foreach (LanguageFile file in filesForProceed) { string value; newResourceDictionary.Clear(); foreach (ItemModel itemModel in EditorDataModel.Items) { switch (file.language) { case LanguageTypes.Languages.lLV: { value = itemModel.Value1; break; } case LanguageTypes.Languages.lRU: { value = itemModel.Value2; break; } case LanguageTypes.Languages.lEN: { value = itemModel.Value3; break; } default: { value = itemModel.Value4; break; } } newResourceDictionary.Add(itemModel.KeyName, value); } result = ResourceDictionaryFunctions.SaveResourceDictionaryToFile(file.file, newResourceDictionary); if (!result) { MessageBox.Show( String.Format("Cannot save resources dictionary '{0}'!", file.language) ); return; } } }