-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR: - Converts the sample app to C# so that we can use C# library as [a compatible part of the Windows support matrix](https://microsoft.github.io/react-native-windows/docs/native-code-language-choice#compatibility-matrix). - Converts multiply method to sync method - Fixes auto-linking
- Loading branch information
Showing
43 changed files
with
1,605 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const path = require('path'); | ||
|
||
// @ts-check | ||
/** @type {import('@react-native-community/cli-types').Config} */ | ||
module.exports = { | ||
dependencies: { | ||
'react-native-pos-tools': { | ||
root: path.join(__dirname, '..'), | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using Microsoft.ReactNative; | ||
using Windows.ApplicationModel.Activation; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace ReactNativePosToolsExample | ||
{ | ||
sealed partial class App : ReactApplication | ||
{ | ||
public App() | ||
{ | ||
#if BUNDLE | ||
JavaScriptBundleFile = "index.windows"; | ||
InstanceSettings.UseWebDebugger = false; | ||
InstanceSettings.UseFastRefresh = false; | ||
#else | ||
JavaScriptBundleFile = "index"; | ||
InstanceSettings.UseWebDebugger = true; | ||
InstanceSettings.UseFastRefresh = true; | ||
#endif | ||
|
||
#if DEBUG | ||
InstanceSettings.UseDeveloperSupport = true; | ||
#else | ||
InstanceSettings.UseDeveloperSupport = false; | ||
#endif | ||
|
||
Microsoft.ReactNative.Managed.AutolinkedNativeModules.RegisterAutolinkedNativeModulePackages(PackageProviders); // Includes any autolinked modules | ||
|
||
PackageProviders.Add(new ReactPackageProvider()); | ||
|
||
InitializeComponent(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is launched normally by the end user. Other entry points | ||
/// will be used such as when the application is launched to open a specific file. | ||
/// </summary> | ||
/// <param name="e">Details about the launch request and process.</param> | ||
protected override void OnLaunched(LaunchActivatedEventArgs e) | ||
{ | ||
base.OnLaunched(e); | ||
var frame = (Frame)Window.Current.Content; | ||
frame.Navigate(typeof(MainPage), e.Arguments); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is activated by some means other than normal launching. | ||
/// </summary> | ||
protected override void OnActivated(Windows.ApplicationModel.Activation.IActivatedEventArgs e) | ||
{ | ||
var preActivationContent = Window.Current.Content; | ||
base.OnActivated(e); | ||
if (preActivationContent == null && Window.Current != null) | ||
{ | ||
// Display the initial content | ||
var frame = (Frame)Window.Current.Content; | ||
frame.Navigate(typeof(MainPage), null); | ||
} | ||
} | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
example/windows/ReactNativePosToolsExample/AutolinkedNativeModules.g.cpp
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
example/windows/ReactNativePosToolsExample/AutolinkedNativeModules.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// AutolinkedNativeModules.g.cs contents generated by "react-native autolink-windows" | ||
|
||
using System.Collections.Generic; | ||
|
||
// Namespaces from react-native-pos-tools | ||
using ReactNativePosTools; | ||
|
||
namespace Microsoft.ReactNative.Managed | ||
{ | ||
internal static class AutolinkedNativeModules | ||
{ | ||
internal static void RegisterAutolinkedNativeModulePackages(IList<IReactPackageProvider> packageProviders) | ||
{ | ||
// IReactPackageProviders from react-native-pos-tools | ||
packageProviders.Add(new ReactNativePosTools.ReactPackageProvider()); | ||
} | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
example/windows/ReactNativePosToolsExample/AutolinkedNativeModules.g.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.