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