-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #156 - Wired up reload JS from bundle file.
- Loading branch information
Showing
12 changed files
with
265 additions
and
13 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
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
25 changes: 25 additions & 0 deletions
25
ReactWindows/ReactNative/DevSupport/IReactInstanceDevCommandsHandler.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,25 @@ | ||
using ReactNative.Bridge; | ||
using System; | ||
|
||
namespace ReactNative.DevSupport | ||
{ | ||
/// <summary> | ||
/// Interface used by <see cref="IDevSupportManager"/> for requesting React | ||
/// instance regeneration based on the option that the user selects in the | ||
/// developer options menu. | ||
/// </summary> | ||
public interface IReactInstanceDevCommandsHandler | ||
{ | ||
/// <summary> | ||
/// Action to notify the <see cref="IReactInstanceManager"/> about the | ||
/// availability of a new JavaScript bundle downloaded from the server. | ||
/// </summary> | ||
void OnJavaScriptBundleLoadedFromServer(); | ||
|
||
/// <summary> | ||
/// Action triggered when the user requests that the application be | ||
/// reloaded from the initially specified bundle file. | ||
/// </summary> | ||
void OnBundleFileReloadRequest(); | ||
} | ||
} |
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,28 @@ | ||
<ContentDialog | ||
x:Class="ReactNative.DevSupport.ProgressDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:ReactNative.DevSupport" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Title="{x:Bind Path=Heading, Mode=OneTime}" | ||
PrimaryButtonText="Dismiss" | ||
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<TextBlock Name="MessageTextBlock" | ||
Text="{x:Bind Path=Message, Mode=OneTime}" | ||
HorizontalAlignment="Center" | ||
Margin="0 10 0 0" | ||
Grid.Row="0" /> | ||
<ProgressRing IsActive="True" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" | ||
Grid.Row="1" /> | ||
</Grid> | ||
</ContentDialog> |
39 changes: 39 additions & 0 deletions
39
ReactWindows/ReactNative/DevSupport/ProgressDialog.xaml.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,39 @@ | ||
using System.Threading; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
// The Content Dialog item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
||
namespace ReactNative.DevSupport | ||
{ | ||
public sealed partial class ProgressDialog : ContentDialog | ||
{ | ||
private readonly CancellationTokenSource _cancellationTokenSource; | ||
|
||
public ProgressDialog(string title, string message) | ||
{ | ||
this.InitializeComponent(); | ||
|
||
Heading = title; | ||
Message = message; | ||
|
||
_cancellationTokenSource = new CancellationTokenSource(); | ||
} | ||
|
||
public string Heading { get; } | ||
|
||
public string Message { get; } | ||
|
||
public CancellationToken Token | ||
{ | ||
get | ||
{ | ||
return _cancellationTokenSource.Token; | ||
} | ||
} | ||
|
||
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) | ||
{ | ||
_cancellationTokenSource.Cancel(); | ||
} | ||
} | ||
} |
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.