public async Task <IField> AddChoiceAsync(string title, FieldChoiceOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } return(await AddFieldAsync(FieldChoiceOptionsToCreation(title, options)).ConfigureAwait(false)); }
private static FieldCreationOptions FieldChoiceOptionsToCreation(string title, FieldChoiceOptions options) { var creationOptions = FieldChoiceMultiOptionsToCreation(title, options); creationOptions.FieldType = FieldType.Choice.ToString(); creationOptions.ImportFromCommonFieldOptions(title, options); creationOptions.SetAttribute("Format", options.EditFormat.ToString()); return(creationOptions); }
public IField AddChoice(string title, FieldChoiceOptions options) { return(AddChoiceAsync(title, options).GetAwaiter().GetResult()); }
public IField AddChoiceBatch(Batch batch, string title, FieldChoiceOptions options) { return(AddChoiceBatchAsync(batch, title, options).GetAwaiter().GetResult()); }
public async Task <IField> AddChoiceBatchAsync(string title, FieldChoiceOptions options) { return(await AddChoiceBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false)); }