本文整理汇总了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);
}
}
}
示例2: Hyperlink_RequestNavigate
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
if (this.NavigateUri != null)
{
System.Diagnostics.Process.Start(this.NavigateUri);
}
}
示例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;
}
示例4: Hyperlink_RequestNavigate
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
if (e != null)
{
System.Diagnostics.Process.Start(e.Uri.AbsoluteUri.ToString());
}
}
示例5: Hyperlink_OnRequestNavigate
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
string uri = e.Uri.AbsoluteUri;
Process.Start(new ProcessStartInfo(uri));
e.Handled = true;
}
示例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;
}
示例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();
}
示例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();
}
}
示例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;
}
示例10: LoginGuestClick
public void LoginGuestClick(object sender, RequestNavigateEventArgs e)
{
ResetStatus();
ClearBlurEffect(_dashboard);
Logger.Debug("Logging in as Guest");
GwupeClientAppContext.CurrentAppContext.LoginManager.LoginGuest();
}
示例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;
}
示例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;
}
示例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;
}
}
示例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();
}
示例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);
}