Exemple #1
0
        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));
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public IField AddChoice(string title, FieldChoiceOptions options)
 {
     return(AddChoiceAsync(title, options).GetAwaiter().GetResult());
 }
Exemple #4
0
 public IField AddChoiceBatch(Batch batch, string title, FieldChoiceOptions options)
 {
     return(AddChoiceBatchAsync(batch, title, options).GetAwaiter().GetResult());
 }
Exemple #5
0
 public async Task <IField> AddChoiceBatchAsync(string title, FieldChoiceOptions options)
 {
     return(await AddChoiceBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false));
 }