示例#1
0
        public void AppendBreak(PromptBreak strength)
        {
            // check for well formed document
            ValidateElement(_elementStack.Peek(), SsmlElement.Break);

            Element breakElement = new(ElementType.Break);

            _elements.Add(breakElement);

            string sBreak = null;

            switch (strength)
            {
            case PromptBreak.None:
                sBreak = "none";
                break;

            case PromptBreak.ExtraSmall:
                sBreak = "x-weak";
                break;

            case PromptBreak.Small:
                sBreak = "weak";
                break;

            case PromptBreak.Medium:
                sBreak = "medium";
                break;

            case PromptBreak.Large:
                sBreak = "strong";
                break;

            case PromptBreak.ExtraLarge:
                sBreak = "x-strong";
                break;

            default:
                throw new ArgumentNullException(nameof(strength));
            }

            breakElement._attributes = new Collection <AttributeItem>();
            breakElement._attributes.Add(new AttributeItem("strength", sBreak));
        }
示例#2
0
        public void AppendBreak(PromptBreak strength)
        {
            ValidateElement(_elementStack.Peek(), SsmlElement.Break);
            Element element = new Element(ElementType.Break);

            _elements.Add(element);
            string text = null;

            switch (strength)
            {
            case PromptBreak.None:
                text = "none";
                break;

            case PromptBreak.ExtraSmall:
                text = "x-weak";
                break;

            case PromptBreak.Small:
                text = "weak";
                break;

            case PromptBreak.Medium:
                text = "medium";
                break;

            case PromptBreak.Large:
                text = "strong";
                break;

            case PromptBreak.ExtraLarge:
                text = "x-strong";
                break;

            default:
                throw new ArgumentNullException("strength");
            }
            element._attributes = new Collection <AttributeItem>();
            element._attributes.Add(new AttributeItem("strength", text));
        }