Exemplo n.º 1
0
        public async Task <IField> AddUserMultiAsync(string title, FieldUserOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(await AddFieldAsync(FieldUserMultiOptionsToCreation(title, options)).ConfigureAwait(false));
        }
Exemplo n.º 2
0
        private static FieldCreationOptions FieldUserOptionsToCreation(string title, FieldUserOptions options)
        {
            FieldCreationOptions creationOptions = new FieldCreationOptions(FieldType.User);

            creationOptions.ImportFromCommonFieldOptions(title, options);
            creationOptions.SetAttribute("UserSelectionMode", ((int)options.SelectionMode).ToString());
            creationOptions.SetAttribute("UserSelectionScope", "0");
            //creationOptions.SetAttribute("IsModern", "TRUE");
            //creationOptions.SetAttribute("Dropdown", "TRUE");
            return(creationOptions);
        }
Exemplo n.º 3
0
        private static FieldCreationOptions FieldUserMultiOptionsToCreation(string title, FieldUserOptions options)
        {
            var creationOptions = FieldUserOptionsToCreation(title, options);

            creationOptions.FieldType = "UserMulti";
            creationOptions.SetAttribute("Mult", "TRUE");
            return(creationOptions);
        }
Exemplo n.º 4
0
 public IField AddUserMulti(string title, FieldUserOptions options)
 {
     return(AddUserMultiAsync(title, options).GetAwaiter().GetResult());
 }
Exemplo n.º 5
0
 public IField AddUserBatch(Batch batch, string title, FieldUserOptions options)
 {
     return(AddUserBatchAsync(batch, title, options).GetAwaiter().GetResult());
 }
Exemplo n.º 6
0
 public async Task <IField> AddUserMultiBatchAsync(string title, FieldUserOptions options)
 {
     return(await AddUserMultiBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false));
 }