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