Exemplo n.º 1
0
        bool AssignValue(Input input, ICommand command, ICommandInputDescriptor descriptor)
        {
            var s = input as SingleValueInput;

            if (s != null)
            {
                return(descriptor.TrySetValue(command, s.Value == string.Empty?Enumerable.Empty <string>() : new[] { s.Value }));
            }

            var m = input as MultiValueInput;

            if (m != null)
            {
                return(descriptor.TrySetValue(command, m.Values));
            }
            throw new InvalidOperationException();
        }
Exemplo n.º 2
0
 static bool AssignValue(Input input, ICommand command, ICommandInputDescriptor descriptor)
 {
     return descriptor.TrySetValue(command, GetValues(input));
 }
Exemplo n.º 3
0
        static bool AssignValue(Input input, ICommand command, ICommandInputDescriptor descriptor)
        {
            var s = input as SingleValueInput;
            if (s != null)
                return descriptor.TrySetValue(command, s.Value == string.Empty ? Enumerable.Empty<string>() : new[] { s.Value });

            var m = input as MultiValueInput;
            if (m != null)
                return descriptor.TrySetValue(command, m.Values);
            throw new InvalidOperationException();
        }
Exemplo n.º 4
0
 static bool AssignValue(Input input, ICommand command, ICommandInputDescriptor descriptor)
 {
     return(descriptor.TrySetValue(command, GetValues(input)));
 }