public async Task <IField> AddCurrencyAsync(string title, FieldCurrencyOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } return(await AddFieldAsync(FieldCurrencyOptionsToCreation(title, options)).ConfigureAwait(false)); }
private static FieldCreationOptions FieldCurrencyOptionsToCreation(string title, FieldCurrencyOptions options) { FieldCreationOptions creationOptions = new FieldCreationOptions(FieldType.Currency); creationOptions.ImportFromCommonFieldOptions(title, options); if (options.Decimals.HasValue) { creationOptions.SetAttribute("Decimals", options.Decimals.ToString().ToUpper()); } if (options.CurrencyLocaleId.HasValue) { creationOptions.SetAttribute("LCID", options.CurrencyLocaleId.ToString().ToUpper()); } return(creationOptions); }
public IField AddCurrency(string title, FieldCurrencyOptions options) { return(AddCurrencyAsync(title, options).GetAwaiter().GetResult()); }
public IField AddCurrencyBatch(Batch batch, string title, FieldCurrencyOptions options) { return(AddCurrencyBatchAsync(batch, title, options).GetAwaiter().GetResult()); }
public async Task <IField> AddCurrencyBatchAsync(string title, FieldCurrencyOptions options) { return(await AddCurrencyBatchAsync(PnPContext.CurrentBatch, title, options).ConfigureAwait(false)); }