示例#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));
 }