-
Notifications
You must be signed in to change notification settings - Fork 19
/
ExampleAddIn.fs
25 lines (21 loc) · 1.13 KB
/
ExampleAddIn.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace Registration.Samples.FSharp
open System
open System.Linq.Expressions
open ExcelDna.Integration
open ExcelDna.Registration
open ExcelDna.Registration.FSharp
type FsAsyncAddIn () =
interface IExcelAddIn with
member this.AutoOpen () =
// The overload selection and delegate conversions performed by F# are not intuitive.
let paramConvertConfig = ParameterConversionConfiguration()
.AddParameterConversion(
Func<Type, ExcelParameterRegistration, LambdaExpression>(FsParameterConversions.FsOptionalParameterConversion),
null)
ExcelRegistration.GetExcelFunctions ()
|> fun fns -> ParameterConversionRegistration.ProcessParameterConversions (fns, paramConvertConfig)
|> FsAsyncRegistration.ProcessFsAsyncRegistrations
|> AsyncRegistration.ProcessAsyncRegistrations
|> MapArrayFunctionRegistration.ProcessMapArrayFunctions
|> ExcelRegistration.RegisterFunctions
member this.AutoClose () = ()