Esempio n. 1
0
        protected override void Execute(CodeActivityContext context)
        {
            var deviceID = (int)DeviceID.Get(context);
            var dynamicEnergyThreshold = (Boolean)DynamicEnergyThreshold.Get(context);
            var energyThresholdValue   = (Int32)EnergyThresholdValue.Get(context);

            if (energyThresholdValue <= 0)
            {
                energyThresholdValue = 300;
            }
            var pauseThreshold = PauseThreshold.Get(context);

            if (pauseThreshold <= 0)
            {
                pauseThreshold = 0.8;
            }
            double?timeoutSeconds  = TimeoutSeconds.Get(context);
            double?phraseTimeLimit = PhraseTimeLimit.Get(context);
            var    inputLanguage   = InputLanguage.Get(context);

            if (inputLanguage.Length < 2)
            {
                inputLanguage = "en-US";
            }
            var apiKey   = APIKey.Get(context);
            var username = Username.Get(context);
            var password = Password.Get(context);
            var engine   = Engine;
            var filePath = FilePath.Get(context);
            IEnumerable <object> inputParameters = new object [] { deviceID, filePath, inputLanguage, apiKey, username, password, engine, dynamicEnergyThreshold, energyThresholdValue, pauseThreshold, timeoutSeconds, phraseTimeLimit };

            OutputParameters.Set(context, inputParameters);
        }