public static ModelItem CreateItem(EditingContext context, Type itemType, CreateOptions options, params object[] arguments) { if (context == null) { throw new ArgumentNullException("context"); } if (itemType == null) { throw new ArgumentNullException("itemType"); } if (!EnumValidator.IsValid(options)) { throw new ArgumentOutOfRangeException("options"); } return(context.Services.GetRequiredService <ModelService>().InvokeCreateItem(itemType, options, arguments)); }
internal DocumentationGenerator(DocumentSettings settings) { DocumentType type = EnumValidator.IsValid(settings.Type) ? settings.Type : DocumentType.Pdf; if (type == DocumentType.Pdf) { FileName = settings.FileName + ".pdf"; ContentType = "application/pdf"; _fileGenerator = new PdfGenerator(settings.FontPath, settings.DomainWithProtocol, settings.FileName); } if (type == DocumentType.Txt) { FileName = settings.FileName + ".txt"; ContentType = "text/plain"; _fileGenerator = new TxtGenerator(settings.DomainWithProtocol); } }