public void UpdateLanguageString(string key, string value, string writingSystemId, bool isCollectionValue) { DataSetElementValue dataSetElementValue; MultiTextBase text; if (TextVariables.TryGetValue(key, out dataSetElementValue)) { text = dataSetElementValue.TextAlternatives; } else { text = new MultiTextBase(); } text.SetAlternative(DealiasWritingSystemId(writingSystemId), value); TextVariables.Remove(key); if (text.Count > 0) { TextVariables.Add(key, new DataSetElementValue(text, isCollectionValue)); } }
public void UpdateLanguageString(string key, XmlString value, string writingSystemId, bool isCollectionValue) { Debug.Assert(writingSystemId != "V" && writingSystemId != "N1" && writingSystemId != "N2", "UpdateLanguageString may no longer be passed an alias writing system ID"); DataSetElementValue dataSetElementValue; MultiTextBase text; if (TextVariables.TryGetValue(key, out dataSetElementValue)) { text = dataSetElementValue.TextAlternatives; } else { text = new MultiTextBase(); } text.SetAlternative(writingSystemId, value?.Xml); TextVariables.Remove(key); if (text.Count > 0) { TextVariables.Add(key, new DataSetElementValue(text, isCollectionValue)); } }