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