Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Retrieve named checking parameter value.
        /// Checks use this to get their setup information.
        /// </summary>
        /// <param name="key">Parameter name</param>
        /// <returns>Parameter value</returns>
        /// ------------------------------------------------------------------------------------
        public string GetParameterValue(string key)
        {
            IWritingSystemManager wsManager = m_cache.ServiceLocator.WritingSystemManager;
            int            hvoWs            = m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.Handle;
            IWritingSystem ws = wsManager.Get(hvoWs);

            if (key.Contains("ValidCharacters"))
            {
                return(GetValidCharactersList(key, ws));
            }

            switch (key)
            {
            case "PoeticStyles":
                return(GetPoeticStyles());

            case "Versification Scheme":
                return(m_scr.Versification.ToString());

            case "IntroductionOutlineStyles":
                //REVIEW: Do we need this? return "Intro_List_Item1";
                return(string.Empty);

            case "PunctCheckLevel":
                return("Intermediate");

            case "PunctWhitespaceChar":
                return(m_punctWhitespaceChar.Substring(0, 1));

            case "MatchedPairs":
                return(ws.MatchedPairs);

            case "PunctuationPatterns":
                return(ws.PunctuationPatterns);

            case "SentenceFinalPunctuation":
                return(GetSentenceFinalPunctuation(ws, m_cache.ServiceLocator.UnicodeCharProps));

            case "QuotationMarkInfo":
                return(ws.QuotationMarks);

            case "StylesInfo":
                return((StyleInfo != null) ? StyleInfo.XmlString : null);

            case "DefaultWritingSystemName":
                return(ws.DisplayLabel);

            case "Verse Bridge":
                return(m_scr.BridgeForWs(hvoWs));

            case "Script Digit Zero":
                return(m_scr.UseScriptDigits ? ((char)m_scr.ScriptDigitZero).ToString() : "0");

            case "Sub-verse Letter A":
                return("a");                        // TODO (TE-8593): Support sub-verse letters for non-Roman text

            case "Sub-verse Letter B":
                return("b");                        // TODO (TE-8593): Support sub-verse letters for non-Roman text

            default:
                string value;
                return((m_checkingParameters.TryGetValue(key, out value)) ? value : string.Empty);
            }
        }