コード例 #1
0
ファイル: InputSets.cs プロジェクト: flowmatters/Veneer
        public void Run(InputSet inputSet)
        {
            ParameterSet parameterSet = ParameterSet(inputSet);

            if (parameterSet == null)
            {
                return;
            }
#if V3 || V4_0 || V4_1 || V4_2_0 || V4_2_1 || V4_2_2 || V4_2_3 || V4_2_4 || V4_2_5 || V4_2_6
            parameterSet.Reset(new Scenario(Scenario));
#else
            parameterSet.Apply(Scenario);
#endif
        }
コード例 #2
0
ファイル: InputSets.cs プロジェクト: flowmatters/Veneer
        public void UpdateInstructions(InputSet inputSet, string[] newInstructions)
        {
            ParameterSet parameterSet = ParameterSet(inputSet);

            if (parameterSet == null)
            {
                parameterSet = new ParameterSet();
                var inputSetParameterSet = new InputSetParameterSet
                {
                    InputSet   = inputSet,
                    Parent     = null,
                    Parameters = parameterSet
                };
                ParameterSetManager().ParameterSets.Add(inputSetParameterSet);
            }
            parameterSet.Configuration.Instructions = String.Join(Environment.NewLine, newInstructions);
        }
コード例 #3
0
ファイル: InputSets.cs プロジェクト: flowmatters/Veneer
        public string[] Instructions(InputSet inputSet)
        {
            ParameterSet parameterSet =
                ParameterSetManager().ParameterSets.FirstOrDefault(x => x.InputSet == inputSet)?.Parameters;

            if (parameterSet == null)
            {
                return(new string[0]);
            }

            try
            {
#if V3 || V4_0 || V4_1 || V4_2_0 || V4_2_1 || V4_2_2 || V4_2_3 || V4_2_4 || V4_2_5 || V4_2_6
                IEnumerable <string> result = parameterSet.Configuration.GetInstructions(new Scenario(Scenario));
#else
                IEnumerable <string> result = parameterSet.Configuration.GetInstructions(Scenario);
#endif
                return(result.ToArray());
            }
            catch
            {
                return(new string[] { "// Couldn't read instructions." });
            }
        }