Пример #1
0
        public async Task <IField> AddMultilineTextAsync(string title, FieldMultilineTextOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(await AddFieldAsync(FieldMultilineTextOptionsToCreation(title, options)).ConfigureAwait(false));
        }
Пример #2
0
 public IField AddMultilineTextBatch(Batch batch, string title, FieldMultilineTextOptions options)
 {
     return(AddMultilineTextBatchAsync(batch, title, options).GetAwaiter().GetResult());
 }
Пример #3
0
        private static FieldCreationOptions FieldMultilineTextOptionsToCreation(string title, FieldMultilineTextOptions options)
        {
            FieldCreationOptions creationOptions = new FieldCreationOptions(FieldType.Note);

            creationOptions.ImportFromCommonFieldOptions(title, options);

            if (options.NumberOfLines.HasValue)
            {
                creationOptions.SetAttribute("NumLines", options.NumberOfLines.ToString());
            }

            if (options.UnlimitedLengthInDocumentLibrary.HasValue)
            {
                creationOptions.SetAttribute("UnlimitedLengthInDocumentLibrary", options.UnlimitedLengthInDocumentLibrary.Value.ToString().ToUpper());
            }

            if (options.RichText.HasValue)
            {
                creationOptions.SetAttribute("RichText", options.RichText.Value.ToString().ToUpper());
            }

            if (options.AppendOnly.HasValue)
            {
                creationOptions.SetAttribute("AppendOnly", options.AppendOnly.Value.ToString().ToUpper());
            }

            if (options.AllowHyperlink.HasValue)
            {
                creationOptions.SetAttribute("AllowHyperlink", options.AllowHyperlink.Value.ToString().ToUpper());
            }

            return(creationOptions);
        }
Пример #4
0
 public async Task <IField> AddMultilineTextBatchAsync(string title, FieldMultilineTextOptions options)
 {
     return(await AddMultilineTextBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false));
 }
Пример #5
0
 public IField AddMultilineText(string title, FieldMultilineTextOptions options)
 {
     return(AddMultilineTextAsync(title, options).GetAwaiter().GetResult());
 }