|
1 | 1 | /* |
2 | | - * Copyright 2019-2021, Optimizely |
| 2 | + * Copyright 2019-2021, 2023, Optimizely |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use file except in compliance with the License. |
|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
| 17 | +#if !(NET35 || NET40 || NETSTANDARD1_6) |
| 18 | +#define USE_ODP |
| 19 | +#endif |
| 20 | + |
17 | 21 | using System; |
18 | 22 | #if !NETSTANDARD1_6 && !NET35 |
19 | 23 | using System.Configuration; |
|
27 | 31 | using OptimizelySDK.Logger; |
28 | 32 | using OptimizelySDK.Notifications; |
29 | 33 |
|
| 34 | +#if USE_ODP |
| 35 | +using OptimizelySDK.Odp; |
| 36 | +#endif |
| 37 | + |
| 38 | + |
30 | 39 | namespace OptimizelySDK |
31 | 40 | { |
32 | 41 | /// <summary> |
@@ -215,8 +224,18 @@ public static Optimizely NewDefaultInstance(ProjectConfigManager configManager, |
215 | 224 | UserProfileService userprofileService = null, EventProcessor eventProcessor = null |
216 | 225 | ) |
217 | 226 | { |
| 227 | +#if USE_ODP |
| 228 | + var odpManager = new OdpManager.Builder() |
| 229 | + .WithErrorHandler(errorHandler) |
| 230 | + .WithLogger(logger) |
| 231 | + .Build(); |
| 232 | + return new Optimizely(configManager, notificationCenter, eventDispatcher, logger, |
| 233 | + errorHandler, userprofileService, eventProcessor, null, odpManager); |
| 234 | +#else |
218 | 235 | return new Optimizely(configManager, notificationCenter, eventDispatcher, logger, |
219 | 236 | errorHandler, userprofileService, eventProcessor); |
| 237 | +#endif |
| 238 | + |
220 | 239 | } |
221 | 240 | } |
222 | 241 | } |
0 commit comments