private static FieldCreationOptions FieldTextOptionsToCreation(string title, FieldTextOptions options) { FieldCreationOptions creationOptions = new FieldCreationOptions(FieldType.Text); creationOptions.ImportFromCommonFieldOptions(title, options); if (options != null && options.MaxLength.HasValue) { creationOptions.SetAttribute("MaxLength", options.MaxLength.ToString()); } return(creationOptions); }
public IField AddText(string title, FieldTextOptions options = null) { return(AddTextAsync(title, options).GetAwaiter().GetResult()); }
public IField AddTextBatch(Batch batch, string title, FieldTextOptions options = null) { return(AddTextBatchAsync(batch, title, options).GetAwaiter().GetResult()); }
public async Task <IField> AddTextAsync(string title, FieldTextOptions options = null) { return(await AddFieldAsync(FieldTextOptionsToCreation(title, options)).ConfigureAwait(false)); }
public async Task <IField> AddTextBatchAsync(string title, FieldTextOptions options = null) { return(await AddTextBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false)); }