Skip to content

Commit

Permalink
Code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuelie committed Aug 29, 2024
1 parent eefac81 commit ae2889d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tests/Shmuelie.WinRTServer.Sample.UwpClient/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ public App()
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame? rootFrame = Window.Current.Content as Frame;

// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
if (Window.Current.Content is not Frame rootFrame)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
Expand Down
4 changes: 2 additions & 2 deletions tests/Shmuelie.WinRTServer.Sample.UwpClient/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public MainPage()
{
this.InitializeComponent();
remoteThing = CreateRemoteThing();
remoteThing.LoopCompleted += _remoteThing_LoopCompleted;
remoteThing.LoopCompleted += RemoteThing_LoopCompleted;
DateTimeUtcBtn.Content = remoteThing.NowUtc.ToString();
}

private void _remoteThing_LoopCompleted(IRemoteThing sender, object args)
private void RemoteThing_LoopCompleted(IRemoteThing sender, object args)
{
_ = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => LoopProg.Value = 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private async void OpenFileBtn_Click(object sender, RoutedEventArgs e)
{
var data = remoteThing.OpenFile("C:\\Windows\\explorer.exe").AsStreamForRead();
byte[] buffer = new byte[10];
await data.ReadAsync(buffer, 0, buffer.Length);
await data.ReadAsync(buffer);
OpenFileTxt.Text = string.Join("", buffer.Select(b => b.ToString("X2")));
}

Expand Down

0 comments on commit ae2889d

Please sign in to comment.