コード例 #1
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));
            }
        }
コード例 #2
0
ファイル: DataSet.cs プロジェクト: gmartin7/myBloomFork
        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));
            }
        }