clipboard/example/windows/ClipboardExample/App.cpp
Alexander Sklar 2b6c52c2cc
Add Windows support to the clipboard module (#70)
Co-authored-by: Alexander Sklar <asklar@winse.microsoft.com>
2020-09-29 10:39:51 +09:00

44 lines
1.2 KiB
C++

#include "pch.h"
#include "App.h"
#include "AutolinkedNativeModules.g.h"
#include "ReactPackageProvider.h"
using namespace winrt::ClipboardExample;
using namespace winrt::ClipboardExample::implementation;
/// <summary>
/// Initializes the singleton application object. This is the first line of
/// authored code executed, and as such is the logical equivalent of main() or
/// WinMain().
/// </summary>
App::App() noexcept
{
MainComponentName(L"example");
#if BUNDLE
JavaScriptBundleFile(L"index.windows");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(false);
#else
JavaScriptMainModuleName(L"index");
InstanceSettings().UseWebDebugger(true);
InstanceSettings().UseFastRefresh(true);
#endif
#if _DEBUG
InstanceSettings().EnableDeveloperMenu(true);
#else
InstanceSettings().EnableDeveloperMenu(false);
#endif
RegisterAutolinkedNativeModulePackages(PackageProviders()); // Includes any autolinked modules
PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project
PackageProviders().Append(winrt::NativeClipboard::ReactPackageProvider());
InitializeComponent();
}