| 1 |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. |
| 2 |
|
| 3 |
using System.Reactive.Concurrency; |
| 4 |
|
| 5 |
namespace System.Reactive.PlatformServices |
| 6 |
{ |
| 7 |
/// <summary> |
| 8 |
/// Provides access to the platform enlightenments used by other Rx libraries to improve system performance and |
| 9 |
/// runtime efficiency. While Rx can run without platform enlightenments loaded, it's recommended to deploy the |
| 10 |
/// System.Reactive.PlatformServices assembly with your application and call <see cref="EnlightenmentProvider. |
| 11 |
/// EnsureLoaded"/> during application startup to ensure enlightenments are properly loaded. |
| 12 |
/// </summary> |
| 13 |
public static class EnlightenmentProvider |
| 14 |
{ |
| 15 |
/// <summary> |
| 16 |
/// Ensures that the calling assembly has a reference to the System.Reactive.PlatformServices assembly with |
| 17 |
/// platform enlightenments. If no reference is made from the user code, it's possible for the build process |
| 18 |
/// to drop the deployment of System.Reactive.PlatformServices, preventing its runtime discovery. |
| 19 |
/// </summary> |
| 20 |
/// <returns> |
| 21 |
/// true if the loaded enlightenment provider matches the provided defined in the current assembly; false |
| 22 |
/// otherwise. When a custom enlightenment provider is installed by the host, false will be returned. |
| 23 |
/// </returns> |
| 24 |
public static bool EnsureLoaded() |
| 25 |
{ |
| 26 |
return PlatformEnlightenmentProvider.Current is CurrentPlatformEnlightenmentProvider; |
| 27 |
} |
| 28 |
} |
| 29 |
} |