Exemple #1
0
        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);
        }
Exemple #2
0
 public IField AddText(string title, FieldTextOptions options = null)
 {
     return(AddTextAsync(title, options).GetAwaiter().GetResult());
 }
Exemple #3
0
 public IField AddTextBatch(Batch batch, string title, FieldTextOptions options = null)
 {
     return(AddTextBatchAsync(batch, title, options).GetAwaiter().GetResult());
 }
Exemple #4
0
 public async Task <IField> AddTextAsync(string title, FieldTextOptions options = null)
 {
     return(await AddFieldAsync(FieldTextOptionsToCreation(title, options)).ConfigureAwait(false));
 }
Exemple #5
0
 public async Task <IField> AddTextBatchAsync(string title, FieldTextOptions options = null)
 {
     return(await AddTextBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false));
 }