public static void SearchMsdn(ILSpyTreeNode node) { var address = string.Empty; var namespaceNode = node as NamespaceTreeNode; if (namespaceNode != null) { address = string.Format(msdnAddress, namespaceNode.Name); } if (node is IMemberTreeNode memberNode) { var member = memberNode.Member; var memberName = string.Empty; if (member.DeclaringType == null) { memberName = member.FullName; } else { memberName = string.Format("{0}.{1}", member.DeclaringType.FullName, member.Name); } address = string.Format(msdnAddress, memberName); } address = address.ToLower(); if (!string.IsNullOrEmpty(address)) { MainWindow.OpenLink(address); } }
public static void SearchMsdn(ILSpyTreeNode node) { var address = string.Empty; if (node is NamespaceTreeNode namespaceNode) { address = string.Format(msdnAddress, namespaceNode.Name); } else if (node is IMemberTreeNode memberNode) { var member = memberNode.Member; var memberName = member.ReflectionName.Replace('`', '-').Replace('+', '.'); if (memberName.EndsWith("..ctor", System.StringComparison.Ordinal)) { memberName = memberName.Substring(0, memberName.Length - 5) + "-ctor"; } address = string.Format(msdnAddress, memberName); } address = address.ToLower(); if (!string.IsNullOrEmpty(address)) { MainWindow.OpenLink(address); } }
private static void ShowAvailableVersion(AvailableVersionInfo availableVersion, StackPanel stackPanel) { if (currentVersion == availableVersion.Version) { stackPanel.Children.Add( new Image { Width = 16, Height = 16, Source = Images.OK, Margin = new Thickness(4, 0, 4, 0) }); stackPanel.Children.Add( new TextBlock { Text = "You are using the latest release.", VerticalAlignment = VerticalAlignment.Bottom }); } else if (currentVersion < availableVersion.Version) { stackPanel.Children.Add( new TextBlock { Text = "Version " + availableVersion.Version + " is available.", Margin = new Thickness(0, 0, 8, 0), VerticalAlignment = VerticalAlignment.Bottom }); if (availableVersion.DownloadUrl != null) { Button button = new Button(); button.Content = "Download"; button.Cursor = Cursors.Arrow; button.Click += delegate { MainWindow.OpenLink(availableVersion.DownloadUrl); }; stackPanel.Children.Add(button); } } else { stackPanel.Children.Add(new TextBlock { Text = "You are using a nightly build newer than the latest release." }); } }
void downloadOrCheckUpdateButtonClick(object sender, RoutedEventArgs e) { if (updateAvailableDownloadUrl != null) { MainWindow.OpenLink(updateAvailableDownloadUrl); } else { updatePanel.Visibility = Visibility.Collapsed; AboutPage.CheckForUpdatesAsync(spySettings ?? ILSpySettings.Load()) .ContinueWith(task => AdjustUpdateUIAfterCheck(task, true), TaskScheduler.FromCurrentSynchronizationContext()); } }
async void downloadOrCheckUpdateButtonClick(object sender, RoutedEventArgs e) { if (updateAvailableDownloadUrl != null) { MainWindow.OpenLink(updateAvailableDownloadUrl); } else { updatePanel.Visibility = Visibility.Collapsed; string downloadUrl = await AboutPage.CheckForUpdatesAsync(ILSpySettings.Load()); AdjustUpdateUIAfterCheck(downloadUrl, true); } }
static void ShowAvailableVersion(AvailableVersionInfo availableVersion, StackPanel stackPanel) { if (currentVersion == availableVersion.Version) { stackPanel.Children.Add( new Image { Width = 16, Height = 16, Source = Images.OK, Margin = new Thickness(4, 0, 4, 0) }); stackPanel.Children.Add( new TextBlock { Text = Resources.UsingLatestRelease, VerticalAlignment = VerticalAlignment.Bottom }); } else if (currentVersion < availableVersion.Version) { stackPanel.Children.Add( new TextBlock { Text = string.Format(Resources.VersionAvailable, availableVersion.Version), Margin = new Thickness(0, 0, 8, 0), VerticalAlignment = VerticalAlignment.Bottom }); if (availableVersion.DownloadUrl != null) { Button button = new Button(); button.Content = Resources.Download; button.Cursor = Cursors.Arrow; button.Click += delegate { MainWindow.OpenLink(availableVersion.DownloadUrl); }; stackPanel.Children.Add(button); } } else { stackPanel.Children.Add(new TextBlock { Text = Resources.UsingNightlyBuildNewerThanLatestRelease }); } }