Beispiel #1
0
        private async void AddParameterSchema(object param)
        {
            if (Strategy == null)
            {
                return;
            }

            if (Strategy.TargetAssembly == null ||
                string.IsNullOrWhiteSpace(Strategy.TargetAssembly.File))
            {
                OnNotification($"{Strategy.Name}'s {nameof(Strategy.TargetAssembly)} must be specified.");
                return;
            }

            try
            {
                var strategyTypeJson = strategyFileManager.GetStrategyTypeAsJson(strategy.TargetAssembly);

                if (string.IsNullOrWhiteSpace(strategyTypeJson))
                {
                    return;
                }

                Strategy.Parameters = strategyTypeJson;

                await strategyService.SaveStrategy(Strategy).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                OnStrategyException(ex);
            }
        }
        private async void AddParameterSchema(object param)
        {
            if (Strategy == null)
            {
                return;
            }

            if (Strategy.TargetAssembly == null ||
                string.IsNullOrWhiteSpace(Strategy.TargetAssembly.File))
            {
                OnStrategyException(new Exception("Target assembly must be specified."));
                return;
            }

            try
            {
                var strategyTypeJson = strategyFileManager.GetStrategyTypeAsJson(strategy.TargetAssembly);

                if (string.IsNullOrWhiteSpace(strategyTypeJson))
                {
                    return;
                }

                Strategy.Parameters = strategyTypeJson;

                await strategyService.SaveStrategy(Strategy);
            }
            catch (Exception ex)
            {
                OnStrategyException(ex);
            }
        }