Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
            }
        }
Esempio n. 4
0
        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));
            }
        }