mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-18 05:10:11 +10:00
Project Maintenance
This commit is contained in:
+2
-3
@@ -37,8 +37,7 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
Process.Start(link.NavigateUri.ToString());
|
||||
}
|
||||
@@ -46,7 +45,7 @@ namespace WPinternals
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,17 +36,18 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
{
|
||||
((BackupTargetSelectionViewModel)DataContext).SwitchToUnlockBoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void FilePicker_PathChanged(object sender, PathChangedEventArgs e)
|
||||
|
||||
@@ -36,23 +36,32 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "Flash")
|
||||
{
|
||||
((FlashResourcesViewModel)DataContext).SwitchToFlashRom();
|
||||
}
|
||||
|
||||
if (link.NavigateUri.ToString() == "UndoRoot")
|
||||
{
|
||||
((FlashResourcesViewModel)DataContext).SwitchToUndoRoot();
|
||||
}
|
||||
|
||||
if (link.NavigateUri.ToString() == "Download")
|
||||
{
|
||||
((FlashResourcesViewModel)DataContext).SwitchToDownload();
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Process.Start(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void FolderPicker_PathChanged(object sender, PathChangedEventArgs e)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace WPinternals
|
||||
InitializeComponent();
|
||||
|
||||
// Setting these properties in XAML results in an error. Why?
|
||||
GifImage.GifSource = @"/aerobusy.gif";
|
||||
GifImage.GifSource = "/aerobusy.gif";
|
||||
GifImage.AutoStart = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,21 +36,26 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
(this.DataContext as DumpRomTargetSelectionViewModel).SwitchToUnlockBoot();
|
||||
{
|
||||
(this.DataContext as DumpRomTargetSelectionViewModel)?.SwitchToUnlockBoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "UnlockRoot")
|
||||
(this.DataContext as DumpRomTargetSelectionViewModel).SwitchToUnlockRoot();
|
||||
{
|
||||
(this.DataContext as DumpRomTargetSelectionViewModel)?.SwitchToUnlockRoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "FlashRom")
|
||||
(this.DataContext as DumpRomTargetSelectionViewModel).SwitchToFlashRom();
|
||||
{
|
||||
(this.DataContext as DumpRomTargetSelectionViewModel)?.SwitchToFlashRom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void FilePicker_PathChanged(object sender, PathChangedEventArgs e)
|
||||
|
||||
+16
-6
@@ -33,8 +33,8 @@ namespace WPinternals
|
||||
/// </summary>
|
||||
public partial class Empty : UserControl
|
||||
{
|
||||
static PhoneNotifierViewModel PhoneNotifier;
|
||||
static SynchronizationContext UIContext;
|
||||
private static PhoneNotifierViewModel PhoneNotifier;
|
||||
private static SynchronizationContext UIContext;
|
||||
|
||||
// Dependency injection is not possible here, because this ViewModel is used in a Style.
|
||||
public Empty()
|
||||
@@ -45,7 +45,7 @@ namespace WPinternals
|
||||
UIContext = SynchronizationContext.Current;
|
||||
|
||||
// Setting these properties in XAML results in an error. Why?
|
||||
GifImage.GifSource = @"/aerobusy.gif";
|
||||
GifImage.GifSource = "/aerobusy.gif";
|
||||
GifImage.AutoStart = true;
|
||||
|
||||
Loaded += Empty_Loaded;
|
||||
@@ -62,7 +62,10 @@ namespace WPinternals
|
||||
// Find the phone notifier
|
||||
DependencyObject obj = (DependencyObject)sender;
|
||||
while (!(obj is MainWindow))
|
||||
{
|
||||
obj = VisualTreeHelper.GetParent(obj);
|
||||
}
|
||||
|
||||
PhoneNotifier = ((MainViewModel)(((MainWindow)obj).DataContext)).PhoneNotifier;
|
||||
|
||||
PhoneNotifier.NewDeviceArrived += PhoneNotifier_NewDeviceArrived;
|
||||
@@ -70,23 +73,30 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "Getting started")
|
||||
{
|
||||
App.NavigateToGettingStarted();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Unlock boot")
|
||||
{
|
||||
App.NavigateToUnlockBoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Interrupt boot")
|
||||
{
|
||||
InterruptBoot = true;
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Normal boot")
|
||||
{
|
||||
InterruptBoot = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty InterruptBootProperty =
|
||||
|
||||
@@ -36,21 +36,26 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "Flash")
|
||||
{
|
||||
((FlashResourcesViewModel)DataContext).SwitchToFlashRom();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Download")
|
||||
{
|
||||
((FlashResourcesViewModel)DataContext).SwitchToDownload();
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Process.Start(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,23 +36,30 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToUnlockBoot();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToUnlockBoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "UnlockRoot")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToUnlockRoot();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToUnlockRoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Dump")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToDumpFFU();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToDumpFFU();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Backup")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToBackup();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToBackup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void FilePicker_PathChanged(object sender, PathChangedEventArgs e)
|
||||
|
||||
@@ -37,31 +37,30 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
switch (link.NavigateUri.ToString())
|
||||
{
|
||||
case "Disclaimer":
|
||||
(this.DataContext as GettingStartedViewModel).ShowDisclaimer();
|
||||
(this.DataContext as GettingStartedViewModel)?.ShowDisclaimer();
|
||||
break;
|
||||
case "UnlockBoot":
|
||||
(this.DataContext as GettingStartedViewModel).SwitchToUnlockBoot();
|
||||
(this.DataContext as GettingStartedViewModel)?.SwitchToUnlockBoot();
|
||||
break;
|
||||
case "UnlockRoot":
|
||||
(this.DataContext as GettingStartedViewModel).SwitchToUnlockRoot();
|
||||
(this.DataContext as GettingStartedViewModel)?.SwitchToUnlockRoot();
|
||||
break;
|
||||
case "Backup":
|
||||
(this.DataContext as GettingStartedViewModel).SwitchToBackup();
|
||||
(this.DataContext as GettingStartedViewModel)?.SwitchToBackup();
|
||||
break;
|
||||
case "Flash":
|
||||
(this.DataContext as GettingStartedViewModel).SwitchToFlashRom();
|
||||
(this.DataContext as GettingStartedViewModel)?.SwitchToFlashRom();
|
||||
break;
|
||||
case "Dump":
|
||||
(this.DataContext as GettingStartedViewModel).SwitchToDumpRom();
|
||||
(this.DataContext as GettingStartedViewModel)?.SwitchToDumpRom();
|
||||
break;
|
||||
case "Download":
|
||||
(this.DataContext as GettingStartedViewModel).SwitchToDownload();
|
||||
(this.DataContext as GettingStartedViewModel)?.SwitchToDownload();
|
||||
break;
|
||||
default:
|
||||
Process.Start(link.NavigateUri.AbsoluteUri);
|
||||
@@ -72,17 +71,17 @@ namespace WPinternals
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void TextBlock_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as TextBlock).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as TextBlock)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void BulletDecorator_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as System.Windows.Controls.Primitives.BulletDecorator).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as System.Windows.Controls.Primitives.BulletDecorator)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,23 +37,30 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToUnlockBoot();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToUnlockBoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "UnlockRoot")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToUnlockRoot();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToUnlockRoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Dump")
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel).SwitchToDumpFFU();
|
||||
{
|
||||
(this.DataContext as LumiaFlashRomSourceSelectionViewModel)?.SwitchToDumpFFU();
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Start(link.NavigateUri.AbsoluteUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,17 +36,18 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
{
|
||||
((LumiaUndoRootTargetSelectionViewModel)DataContext).SwitchToUnlockBoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,25 +37,34 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "Dump")
|
||||
{
|
||||
((LumiaUnlockRootTargetSelectionViewModel)DataContext).SwitchToDumpRom();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Flash")
|
||||
{
|
||||
((LumiaUnlockRootTargetSelectionViewModel)DataContext).SwitchToFlashRom();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
{
|
||||
((LumiaUnlockRootTargetSelectionViewModel)DataContext).SwitchToUnlockBoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "GettingStarted")
|
||||
{
|
||||
App.NavigateToGettingStarted();
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Start(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void FolderPicker_PathChanged(object sender, PathChangedEventArgs e)
|
||||
|
||||
@@ -46,7 +46,9 @@ namespace WPinternals
|
||||
private void MainViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "ContextViewModel")
|
||||
{
|
||||
MainContentScrollViewer.ScrollToTop();
|
||||
}
|
||||
}
|
||||
|
||||
private void ScrollViewer_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
@@ -58,11 +60,13 @@ namespace WPinternals
|
||||
if (e.WidthChanged)
|
||||
{
|
||||
if (e.NewSize.Width >= (MaxChildWidth + (2 * MarginTarget)))
|
||||
{
|
||||
ChildFrame.Width = MaxChildWidth;
|
||||
else if ((e.NewSize.Width - (2 * MarginTarget)) < MinChildWidth)
|
||||
ChildFrame.Width = MinChildWidth;
|
||||
}
|
||||
else
|
||||
ChildFrame.Width = e.NewSize.Width - (2 * MarginTarget);
|
||||
{
|
||||
ChildFrame.Width = (e.NewSize.Width - (2 * MarginTarget)) < MinChildWidth ? MinChildWidth : e.NewSize.Width - (2 * MarginTarget);
|
||||
}
|
||||
}
|
||||
ChildFrame.Margin = new Thickness(0, 20, 0, 20);
|
||||
}
|
||||
@@ -70,7 +74,9 @@ namespace WPinternals
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
if ((Application.Current.MainWindow != this) && (Application.Current.MainWindow != null))
|
||||
{
|
||||
Application.Current.MainWindow.Close(); // This one holds the hWnd for handling USB events and it must be closed too.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,25 +34,25 @@ namespace WPinternals
|
||||
InitializeComponent();
|
||||
|
||||
// Setting these properties in XAML results in an error. Why?
|
||||
GifImage.GifSource = @"/aerobusy.gif";
|
||||
GifImage.GifSource = "/aerobusy.gif";
|
||||
GifImage.AutoStart = true;
|
||||
}
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if ((link != null) && (link.NavigateUri != null))
|
||||
if (link?.NavigateUri != null)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "GettingStarted")
|
||||
(this.DataContext as NokiaBootloaderViewModel).SwitchToGettingStarted();
|
||||
|
||||
(this.DataContext as NokiaBootloaderViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
{
|
||||
(this.DataContext as NokiaBootloaderViewModel)?.SwitchToGettingStarted();
|
||||
} (this.DataContext as NokiaBootloaderViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,18 +37,18 @@ namespace WPinternals
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if ((link != null) && (link.NavigateUri != null))
|
||||
if (link?.NavigateUri != null)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "GettingStarted")
|
||||
(this.DataContext as NokiaFlashViewModel).SwitchToGettingStarted();
|
||||
|
||||
(this.DataContext as NokiaFlashViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
{
|
||||
(this.DataContext as NokiaFlashViewModel)?.SwitchToGettingStarted();
|
||||
} (this.DataContext as NokiaFlashViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace WPinternals
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace WPinternals
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,16 +36,15 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
(this.DataContext as NokiaModeBootloaderViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
(this.DataContext as NokiaModeBootloaderViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,16 +36,15 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
(this.DataContext as NokiaModeFlashViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
(this.DataContext as NokiaModeFlashViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,16 +36,15 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
(this.DataContext as NokiaModeLabelViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
(this.DataContext as NokiaModeLabelViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,16 +36,15 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
(this.DataContext as NokiaModeMassStorageViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
(this.DataContext as NokiaModeMassStorageViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,16 +36,15 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
(this.DataContext as NokiaModeNormalViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
(this.DataContext as NokiaModeNormalViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,17 +36,15 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
(this.DataContext as NokiaNormalViewModel).RebootTo(link.NavigateUri.ToString());
|
||||
(this.DataContext as NokiaNormalViewModel)?.RebootTo(link.NavigateUri.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,19 +36,22 @@ namespace WPinternals
|
||||
|
||||
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Hyperlink link = args.Source as Hyperlink;
|
||||
if (link != null)
|
||||
if (args.Source is Hyperlink link)
|
||||
{
|
||||
if (link.NavigateUri.ToString() == "UnlockBoot")
|
||||
(this.DataContext as RestoreSourceSelectionViewModel).SwitchToUnlockBoot();
|
||||
{
|
||||
(this.DataContext as RestoreSourceSelectionViewModel)?.SwitchToUnlockBoot();
|
||||
}
|
||||
else if (link.NavigateUri.ToString() == "Flash")
|
||||
(this.DataContext as RestoreSourceSelectionViewModel).SwitchToFlashRom();
|
||||
{
|
||||
(this.DataContext as RestoreSourceSelectionViewModel)?.SwitchToFlashRom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Document_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(sender as FlowDocument).AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
(sender as FlowDocument)?.AddHandler(Hyperlink.ClickEvent, new RoutedEventHandler(HandleHyperlinkClick));
|
||||
}
|
||||
|
||||
private void FilePicker_PathChanged(object sender, PathChangedEventArgs e)
|
||||
|
||||
@@ -41,11 +41,18 @@ namespace WPinternals
|
||||
|
||||
bool NeedLicenseAgrement = false;
|
||||
if (Registry.CurrentUser.OpenSubKey("Software\\WPInternals") == null)
|
||||
{
|
||||
Registry.CurrentUser.OpenSubKey("Software", true).CreateSubKey("WPInternals");
|
||||
}
|
||||
|
||||
if ((Registration.IsPrerelease) && (Registry.CurrentUser.OpenSubKey("Software\\WPInternals").GetValue("NdaAccepted") == null))
|
||||
{
|
||||
NeedLicenseAgrement = true;
|
||||
}
|
||||
else if (Registry.CurrentUser.OpenSubKey("Software\\WPInternals").GetValue("DisclaimerAccepted") == null)
|
||||
{
|
||||
NeedLicenseAgrement = true;
|
||||
}
|
||||
|
||||
if ((!Registration.IsPrerelease || Registration.IsRegistered()) && !NeedLicenseAgrement)
|
||||
{
|
||||
@@ -54,7 +61,7 @@ namespace WPinternals
|
||||
System.Threading.SynchronizationContext UIContext = System.Threading.SynchronizationContext.Current;
|
||||
await CommandLine.ParseCommandLine(UIContext);
|
||||
}
|
||||
else if (Environment.GetCommandLineArgs().Count() > 1)
|
||||
else if (Environment.GetCommandLineArgs().Length > 1)
|
||||
{
|
||||
Console.WriteLine("First time use");
|
||||
Console.WriteLine("Switching to graphic user interface for license and registration");
|
||||
|
||||
Reference in New Issue
Block a user