Exemple #1
0
        public async Task <IField> AddLookupMultiAsync(string title, FieldLookupOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(await AddFieldAsync(FieldLookupMultiOptionsToCreation(title, options)).ConfigureAwait(false));
        }
Exemple #2
0
        private static FieldCreationOptions FieldLookupOptionsToCreation(string title, FieldLookupOptions options)
        {
            FieldCreationOptions creationOptions = new FieldCreationOptions(FieldType.Lookup);

            creationOptions.ImportFromCommonFieldOptions(title, options);
            creationOptions.SetAttribute("ShowField", options.LookupFieldName);
            creationOptions.SetAttribute("List", options.LookupListId.ToString());
            return(creationOptions);
        }
Exemple #3
0
        private static FieldCreationOptions FieldLookupMultiOptionsToCreation(string title, FieldLookupOptions options)
        {
            var creationOptions = FieldLookupOptionsToCreation(title, options);

            creationOptions.FieldType = "LookupMulti";
            creationOptions.SetAttribute("Mult", "TRUE");
            return(creationOptions);
        }
Exemple #4
0
 public IField AddLookupMulti(string title, FieldLookupOptions options)
 {
     return(AddLookupMultiAsync(title, options).GetAwaiter().GetResult());
 }
Exemple #5
0
 public IField AddLookupMultiBatch(Batch batch, string title, FieldLookupOptions options)
 {
     return(AddLookupMultiBatchAsync(batch, title, options).GetAwaiter().GetResult());
 }
Exemple #6
0
 public async Task <IField> AddLookupMultiBatchAsync(string title, FieldLookupOptions options)
 {
     return(await AddLookupMultiBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false));
 }