public void AddLanguageString(string key, XmlString value, string writingSystemId, bool isCollectionValue) { if (!TextVariables.ContainsKey(key)) { var text = new MultiTextBase(); TextVariables.Add(key, new DataSetElementValue(text, isCollectionValue)); } TextVariables[key].TextAlternatives.SetAlternative(writingSystemId, value?.Xml); }
public void UpdateGenericLanguageString(string key, XmlString value, bool isCollectionValue) { var text = new MultiTextBase(); text.SetAlternative("*", value?.Xml); if (TextVariables.ContainsKey(key)) { TextVariables.Remove(key); } TextVariables.Add(key, new DataSetElementValue(text, isCollectionValue)); }
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)); } }