예제 #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();
        }
예제 #2
0
 static bool AssignValue(Input input, ICommand command, ICommandInputDescriptor descriptor)
 {
     return descriptor.TrySetValue(command, GetValues(input));
 }
예제 #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();
        }
예제 #4
0
 static bool AssignValue(Input input, ICommand command, ICommandInputDescriptor descriptor)
 {
     return(descriptor.TrySetValue(command, GetValues(input)));
 }