/// <summary>
 /// Handles the RequestNavigate event of the richTextBoxAdv control.
 /// </summary>
 /// <param name="obj">The source of the event.</param>
 /// <param name="args">The <see cref="Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs"/> instance containing the event data.</param>
 void RichTextBoxAdv_RequestNavigate(object obj, Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs args)
 {
     if (args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Webpage || args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Email)
         LaunchUri(new Uri(args.Hyperlink.NavigationLink).AbsoluteUri);
     else if (args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.File && File.Exists(args.Hyperlink.NavigationLink))
       LaunchUri(args.Hyperlink.NavigationLink);
 }
        /// <summary>
        /// Handles the RequestNavigate event of the richTextBoxAdv control.
        /// </summary>
        /// <param name="obj">The source of the event.</param>
        /// <param name="args">The <see cref="Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs"/> instance containing the event data.</param>
        internal void RichTextBoxAdv_RequestNavigate(object obj, Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs args)
        {
            if (args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Webpage || args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Email)
            {
                Uri uri = new Uri(args.Hyperlink.NavigationLink);
#if NETCORE
                ProcessStartInfo processStartInfo = new ProcessStartInfo
                {
                    FileName        = "cmd",
                    WindowStyle     = ProcessWindowStyle.Hidden,
                    UseShellExecute = false,
                    CreateNoWindow  = true,
                    Arguments       = $"/c start " + uri.AbsoluteUri
                };
                Process.Start(processStartInfo);
#else
                Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
#endif
            }
            else if (args.Hyperlink.LinkType == HyperlinkType.File && File.Exists(args.Hyperlink.NavigationLink))
#if NETCORE
            { System.Diagnostics.Process.Start(@"cmd.exe", @"/c start " + args.Hyperlink.NavigationLink); }
#else
            { Process.Start(args.Hyperlink.NavigationLink); }
#endif
        }
Beispiel #3
0
 /// <summary>
 /// Handles the RequestNavigate event of the richTextBoxAdv control.
 /// </summary>
 /// <param name="obj">The source of the event.</param>
 /// <param name="args">The <see cref="Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs"/> instance containing the event data.</param>
 void RichTextBoxAdv_RequestNavigate(object obj, Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs args)
 {
     if (args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Webpage || args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Email)
     {
         Uri uri = new Uri(args.Hyperlink.NavigationLink);
         Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
     }
     else if (args.Hyperlink.LinkType == HyperlinkType.File && File.Exists(args.Hyperlink.NavigationLink))
     {
         Process.Start(args.Hyperlink.NavigationLink);
     }
 }
        /// <summary>
        /// Handles the RequestNavigate event of the richTextBoxAdv control.
        /// </summary>
        /// <param name="obj">The source of the event.</param>
        /// <param name="args">The <see cref="Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs"/> instance containing the event data.</param>
        void RichTextBoxAdv_RequestNavigate(object obj, Syncfusion.Windows.Controls.RichTextBoxAdv.RequestNavigateEventArgs args)
        {
            if (args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Webpage || args.Hyperlink.LinkType == Syncfusion.Windows.Controls.RichTextBoxAdv.HyperlinkType.Email)
            {
                Uri uri = new Uri(args.Hyperlink.NavigationLink);
#if NETCORE
                System.Diagnostics.Process.Start(@"cmd.exe", @"/c start " + uri.AbsoluteUri);
#else
                Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
#endif
            }
            else if (args.Hyperlink.LinkType == HyperlinkType.File && File.Exists(args.Hyperlink.NavigationLink))
#if NETCORE
            { System.Diagnostics.Process.Start(@"cmd.exe", @"/c start " + args.Hyperlink.NavigationLink); }
#else
            { Process.Start(args.Hyperlink.NavigationLink); }
#endif
        }