示例#1
0
        public TranslatedText(TranslationLanguage detectedSourceLanguage, IdentifiableText text)
        {
            Guard.ObjectNotNull(() => detectedSourceLanguage);
            Guard.ObjectNotNull(() => text);

            DetectedSourceLanguage = detectedSourceLanguage;
            Text = text;
        }
        internal TextTranslationRequest(
            TranslationLanguage targetLanguage,
            Maybe <TranslationLanguage> sourceLanguage,
            Maybe <IgnoreForTranslationMarkup> ignoreMarkup,
            IReadOnlyCollection <IdentifiableText> textParts)
        {
            Guard.ObjectNotNull(() => targetLanguage);
            Guard.ObjectNotNull(() => sourceLanguage);
            Guard.ObjectNotNull(() => ignoreMarkup);
            Guard.ObjectNotNull(() => textParts);
            Guard.That(() => textParts.Count <= MaxTextParts, "Only to 50 text parameters can be submitted in one request.");

            TargetLanguage = targetLanguage;
            SourceLanguage = sourceLanguage;
            IgnoreMarkup   = ignoreMarkup;
            TextParts      = textParts;
        }