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