예제 #1
0
 public FormatTemplateElement([NotNull] Delegate formatTemplate,
                              [CanBeNull] CanExecute canFormat,
                              [NotNull] Type inputTypes,
                              [CanBeNull] Type outputType,
                              [NotNull][ItemNotNull] MultiFormatterInfo[] argumentMeta)
 {
     Format     = formatTemplate ?? throw new ArgumentNullException(nameof(formatTemplate));
     CanFormat  = canFormat;
     InputTypes = inputTypes ?? throw new ArgumentNullException(nameof(inputTypes));
     OutputType = outputType ?? throw new ArgumentNullException(nameof(outputType));
     MetaData   = new MultiFormatterInfoCollection(argumentMeta ?? throw new ArgumentNullException(nameof(argumentMeta)));
     if (MetaData.Any(e => e == null))
     {
         throw new InvalidOperationException("You cannot use a Null value in the collection of MultiFormatterInfo");
     }
 }