Beispiel #1
0
 internal TranslationResult(XUnity.AutoTranslator.Plugin.Core.TranslationResult src)
 {
     Source         = src;
     Succeeded      = Source?.Succeeded ?? false;
     TranslatedText = Source?.TranslatedText;
     ErrorMessage   = Source?.ErrorMessage;
 }
        public void Associate(object ui, TranslationResult translationResult, ParserTranslationContext context)
        {
            if (context != null)
            {
                Contexts.Add(context);
                context.Jobs.Add(this);
            }
            else
            {
                if (ui != null && !ui.IsSpammingComponent())
                {
                    Components.Add(ui);
                }

                if (translationResult != null)
                {
                    TranslationResults.Add(translationResult);
                }
            }
        }
 public ParserTranslationContext(object component, TranslationEndpointManager endpoint, TranslationResult translationResult, ParserResult result)
 {
     Jobs              = new HashSet <TranslationJob>();
     Component         = component;
     Result            = result;
     Endpoint          = endpoint;
     TranslationResult = translationResult;
 }