示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds a rendering.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void AddRendering(string rendering)
        {
            if (Renderings.Contains(rendering.Normalize(NormalizationForm.FormD)))
            {
                throw new ArgumentException(Properties.Resources.kstidRenderingExists);
            }
            KeyTermRenderingInfo info = RenderingInfo;

            if (info == null)
            {
                info = new KeyTermRenderingInfo(Term, BestRendering);
                m_keyTermRenderingInfo.Add(info);
            }
            info.AddlRenderings.Add(rendering);
            UpdateRenderingInfoFile();
        }
示例#2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds a rendering.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void AddRendering(string rendering)
        {
            string normalizedForm = rendering.Normalize(NormalizationForm.FormC);

            if (Renderings.Contains(normalizedForm))
            {
                throw new ArgumentException(Properties.Resources.kstidRenderingExists);
            }
            KeyTermRenderingInfo info = RenderingInfo;

            if (info == null)
            {
                info = new KeyTermRenderingInfo(m_termSurrogate.TermId, BestRendering);
                m_keyTermRenderingInfo.Add(info);
            }
            info.AddlRenderings.Add(rendering);
            m_allRenderings.Add(normalizedForm);
            if (m_bestTranslation == string.Empty)
            {
                m_bestTranslation = rendering;
            }
            UpdateRenderingInfoFile();
        }