Exemplo n.º 1
0
 private QueryParameter CreateParameter(QueryParameterTemplate template)
 {
     if (!TryGetParameter(template, out var parameter))
     {
         parameter = new QueryParameter(template, null);
         Add(parameter);
     }
     return(parameter);
 }
Exemplo n.º 2
0
        public void SelectValue(QueryParameterTemplate template, object value)
        {
            var parameter = CreateParameter(template);

            if (parameter.Selection.Contains(value))
            {
                return;
            }
            parameter.Selection.Add(value);
        }
Exemplo n.º 3
0
 public static Action CreateAddParameterAction(QueryParameterTemplate template)
 {
     if (template == null)
     {
         throw new ArgumentNullException(nameof(template));
     }
     return(new Action(QueryFormatActionType.AddParameter)
     {
         Template = template,
     });
 }
Exemplo n.º 4
0
 public static Action CreateAddSelectableValueAction(
     QueryParameterTemplate template, object selectableValue)
 {
     if (template == null)
     {
         throw new ArgumentNullException(nameof(template));
     }
     return(new Action(QueryFormatActionType.AddSelectableValue)
     {
         Template = template,
         NewSelectableValue = selectableValue,
     });
 }
Exemplo n.º 5
0
 public void AddSelectableValue(QueryParameterTemplate template, object selectableValue) =>
 PerformAction(Action.CreateAddSelectableValueAction(template, selectableValue));
Exemplo n.º 6
0
 public void AddParameter(QueryParameterTemplate template) =>
 PerformAction(Action.CreateAddParameterAction(template));
Exemplo n.º 7
0
 internal QueryFormatParameter(QueryParameterTemplate template)
 {
     Template = template ?? throw new ArgumentNullException(nameof(template));
 }
Exemplo n.º 8
0
 public bool TryGetParameter(QueryParameterTemplate template, out QueryParameter parameter)
 {
     parameter = Parameters.FirstOrDefault(i => i.Template == template);
     return(parameter != null);
 }
Exemplo n.º 9
0
        public void DeselectValue(QueryParameterTemplate template, object value)
        {
            var parameter = CreateParameter(template);

            parameter.Selection.Remove(value);
        }
Exemplo n.º 10
0
 public void SetValue(QueryParameterTemplate template, object value)
 {
     CreateParameter(template).Value = value;
 }