当前位置: 首页>>代码示例>>C#>>正文


C# Navigation.RequestNavigateEventArgs类代码示例

本文整理汇总了C#中System.Windows.Navigation.RequestNavigateEventArgs的典型用法代码示例。如果您正苦于以下问题:C# RequestNavigateEventArgs类的具体用法?C# RequestNavigateEventArgs怎么用?C# RequestNavigateEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RequestNavigateEventArgs类属于System.Windows.Navigation命名空间,在下文中一共展示了RequestNavigateEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnRequestNavigateFromUrl

        private void OnRequestNavigateFromUrl(object sender, RequestNavigateEventArgs e)
        {
            ILink link = _session.FromLink(e.Uri.OriginalString);

            if (link != null)
            {
                if (link is ILink<IArtist>)
                {
                    IArtist artist = ((ILink<IArtist>)link).Object;
                    Artist torshifyArtist = new Artist(artist, Application.Current.Dispatcher);
                    CoreCommands.Views.GoToArtistCommand.Execute(torshifyArtist);
                }
                else if (link is ILink<IAlbum>)
                {
                    IAlbum album = ((ILink<IAlbum>)link).Object;
                    Album torshifyAlbum = new Album(album, Application.Current.Dispatcher);
                    CoreCommands.Views.GoToAlbumCommand.Execute(torshifyAlbum);
                }
                else if (link is ILink<ITrackAndOffset>)
                {
                    ITrackAndOffset track = ((ILink<ITrackAndOffset>) link).Object;
                    Track torshifyTrack = new Track(track.Track, Application.Current.Dispatcher);
                    CoreCommands.PlayTrackCommand.Execute(torshifyTrack);
                    CoreCommands.Player.SeekCommand.Execute(track.Offset);
                }
            }
        }
开发者ID:krikelin,项目名称:torshify-client,代码行数:27,代码来源:SpotifyLinkNavigator.cs

示例2: Hyperlink_RequestNavigate

 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     if (this.NavigateUri != null)
     {
         System.Diagnostics.Process.Start(this.NavigateUri);
     }
 }
开发者ID:Microsoft,项目名称:sarif-sdk,代码行数:7,代码来源:InternetHyperlink.xaml.cs

示例3: Hyperlink_RequestNavigate

 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     Uri uri = e.Uri;
     try { Process.Start(new ProcessStartInfo(uri.AbsoluteUri)); }
     catch { }
     e.Handled = true;
 }
开发者ID:stevenzeiler,项目名称:FeenPhone,代码行数:7,代码来源:AboutWPF.xaml.cs

示例4: Hyperlink_RequestNavigate

 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     if (e != null)
     {
         System.Diagnostics.Process.Start(e.Uri.AbsoluteUri.ToString());
     }
 }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:7,代码来源:MainWindow.xaml.cs

示例5: Hyperlink_OnRequestNavigate

        private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            string uri = e.Uri.AbsoluteUri;
            Process.Start(new ProcessStartInfo(uri));

            e.Handled = true;
        }
开发者ID:Jupotter,项目名称:Terre-Natale-Calculateur,代码行数:7,代码来源:AboutDialog.xaml.cs

示例6: Hyperlink_OnRequestNavigate

 private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     if (sender == null) throw new ArgumentNullException("sender");
     if (e == null) throw new ArgumentNullException("e");
     Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
     e.Handled = true;
 }
开发者ID:NoImNot,项目名称:LolAnimationChanger,代码行数:7,代码来源:About.xaml.cs

示例7: hbUpdates_RequestNavigate

        private void hbUpdates_RequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            tbVersion.Text = String.Format("{0} ({1})", VersionUtil.GetVersionName(), UI.CheckingForUpdates);
            e.Handled = true;

            versionChecker = new BackgroundWorker();
            versionChecker.DoWork += delegate(object s, DoWorkEventArgs args)
            {
                string text;
                if (!UpdateChecker.IsWorking())
                {
                    text = UI.FailedToRetrieveUpdateInformation;
                }
                else if (UpdateChecker.IsUpdateAvailable())
                {
                    text = String.Format(UI.UpdateAvailable, UpdateChecker.GetLastReleasedVersion().Version, UpdateChecker.GetLastReleasedVersion().ReleaseDate);
                }
                else
                {
                    text = UI.NoUpdateAvailable;
                }

                args.Result = String.Format("{0} ({1})", VersionUtil.GetVersionName(), text);
            };
            versionChecker.RunWorkerCompleted += delegate(object s, RunWorkerCompletedEventArgs args)
            {
                tbVersion.Text = args.Result as string;
            };
            versionChecker.RunWorkerAsync();
        }
开发者ID:WillStefan,项目名称:MPExtended,代码行数:30,代码来源:TabProject.xaml.cs

示例8: Paste_RequestNavigate

 private void Paste_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     TextPointer start = this._rtb.Document.ContentStart,
                 end = this._rtb.Document.ContentEnd;
     TextRange tr = new TextRange(start, end);
     tr.Select(start, end);
     MemoryStream ms;
     StringBuilder sb = new StringBuilder();
     foreach (String dataFormat in _listOfFormats)
     {
         if (tr.CanSave(dataFormat))
         {
             ms = new MemoryStream();
             tr.Save(ms, dataFormat);
             ms.Seek(0, SeekOrigin.Begin);
             sb.AppendLine(dataFormat);
             foreach (char c in ms.ToArray().Select<byte, char>((b) => (char)b))
             {
                 sb.Append(c);
             }
             sb.AppendLine();
         }
         //_tb.Text = sb.ToString();
     }
 }
开发者ID:jithuin,项目名称:infogeezer,代码行数:25,代码来源:LinkRichTextView.xaml.cs

示例9: link_RequestNavigate

 private void link_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     var startArgs = @"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe";
     var startInfo = new ProcessStartInfo(startArgs, e.Uri.AbsoluteUri);
     Process.Start(startInfo);
     e.Handled = true;
 }
开发者ID:vendettamit,项目名称:stackoverflowclient,代码行数:7,代码来源:MainWindowView.xaml.cs

示例10: LoginGuestClick

 public void LoginGuestClick(object sender, RequestNavigateEventArgs e)
 {
     ResetStatus();
     ClearBlurEffect(_dashboard);
     Logger.Debug("Logging in as Guest");
     GwupeClientAppContext.CurrentAppContext.LoginManager.LoginGuest();
 }
开发者ID:gwupe,项目名称:Gwupe,代码行数:7,代码来源:LoginControl.xaml.cs

示例11: Hyperlink_RequestNavigate

        private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            var hyperlink = sender as Hyperlink;

            Process.Start(new ProcessStartInfo(hyperlink.NavigateUri.ToString()));
            e.Handled = true;
        }
开发者ID:mmdurrant,项目名称:ChocolateyExplorer,代码行数:7,代码来源:Packages.xaml.cs

示例12: HyperlinkRequestNavigate

 /// <summary>Handle a hyperlink click event</summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The <see cref="RequestNavigateEventArgs"/> object.</param>
 private void HyperlinkRequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     Hyperlink hl = (Hyperlink)sender;
     string navigateUri = hl.NavigateUri.ToString();
     Process.Start(new ProcessStartInfo(navigateUri));
     e.Handled = true;
 }
开发者ID:andreaskoch,项目名称:Hostfile-Manager,代码行数:10,代码来源:About.xaml.cs

示例13: OnMouseDown

 protected internal override void OnMouseDown(MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left && !e.Handled && LinkIsClickable())
     {
         RequestNavigateEventArgs args = new RequestNavigateEventArgs(this.NavigateUri, this.TargetName);
         args.RoutedEvent = Hyperlink.RequestNavigateEvent;
         FrameworkElement element = e.Source as FrameworkElement;
         if (element != null)
         {
             // allow user code to handle the navigation request
             element.RaiseEvent(args);
         }
         if (!args.Handled)
         {
             try
             {
                 Process.Start(this.NavigateUri.ToString());
             }
             catch
             {
                 // ignore all kinds of errors during web browser start
             }
         }
         e.Handled = true;
     }
 }
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:26,代码来源:VisualLineLinkText.cs

示例14: hbUpdates_RequestNavigate

        private void hbUpdates_RequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            tbVersion.Text = String.Format("{0} (checking for updates...)", VersionUtil.GetVersionName());
            e.Handled = true;

            versionChecker = new BackgroundWorker();
            versionChecker.DoWork += delegate(object s, DoWorkEventArgs args)
            {
                string text;
                if (!UpdateChecker.IsWorking())
                {
                    text = "failed to retrieve update information";
                }
                else if (UpdateChecker.IsUpdateAvailable())
                {
                    text = String.Format("update available: version {0}, released on {1:dd MMM yyyy}",
                        UpdateChecker.GetLastReleasedVersion().Version, UpdateChecker.GetLastReleasedVersion().ReleaseDate);
                }
                else
                {
                    text = "no update available";
                }

                args.Result = String.Format("{0} ({1})", VersionUtil.GetVersionName(), text);
            };
            versionChecker.RunWorkerCompleted += delegate(object s, RunWorkerCompletedEventArgs args)
            {
                tbVersion.Text = args.Result as string;
            };
            versionChecker.RunWorkerAsync();
        }
开发者ID:aredon,项目名称:MPExtended,代码行数:31,代码来源:TabProject.xaml.cs

示例15: OnRequestNavigate

        private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            if (e.Uri == null)
            {
                return;
            }

            BrowserHelper.StartBrowser(e.Uri);
            e.Handled = true;

            var hyperlink = sender as Hyperlink;
            if (hyperlink == null)
            {
                return;
            }

            var item = hyperlink.Tag as DiagnosticData;
            if (item == null)
            {
                return;
            }

            var telemetry = item.CustomTags.Any(t => t == WellKnownDiagnosticTags.Telemetry);
            DiagnosticLogger.LogHyperlink("ErrorList", item.Id, item.Description != null, telemetry, e.Uri.AbsoluteUri);
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:25,代码来源:UriNavigator.cs


注:本文中的System.Windows.Navigation.RequestNavigateEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。