private void SetUserArgument(CreationType creationType, string setting, string value)
        {
            var argument = GetUserArgument(creationType, setting);

            if (argument == null)
            {
                if (value != null)
                {
                    UserArguments.Add(new Argument {
                        Name = setting, SettingType = creationType, Value = value
                    });
                }
            }
            else if (value == null)
            {
                UserArguments.Remove(argument);
            }
            else
            {
                argument.Value = value;
            }
        }
示例#2
0
        private void SetUserArgument(CreationType creationType, string setting, string value)
        {
            var argument = UserArguments.FirstOrDefault(s =>
                                                        string.Equals(s.Name, setting, StringComparison.InvariantCultureIgnoreCase) &&
                                                        s.SettingType == creationType);

            if (argument == null)
            {
                if (value != null)
                {
                    UserArguments.Add(new Argument {
                        Name = setting, SettingType = creationType, Value = value
                    });
                }
            }
            else if (value == null)
            {
                UserArguments.Remove(argument);
            }
            else
            {
                argument.Value = value;
            }
        }