protected override void OnIsHyperlink(IsHyperlinkEventArgs e)
        {
            base.OnIsHyperlink(e);

            e.Url = null;

            var rowObject = (RowObject)e.Model;

            if (e.Column == mFieldValues)
            {
                if (rowObject.Value != null && !rowObject.Value.IsProtected)
                {
                    var value = GetDisplayValue(rowObject.Value, true);
                    Uri uri;
                    var match = EntryView.MarkedLinkRegex.Match(value);
                    if (match.Success && match.Length == value.Length)                     // It's a URL if the whole thing matches marked link syntax (< > wrapped)
                    {
                        e.Url = value.Substring(1, value.Length - 2);
                    }
                    else if (rowObject.FieldName == PwDefs.UrlField ||                     // Assume a URL if in the URL field, even if it doesn't look like one
                             Uri.TryCreate(value, UriKind.Absolute, out uri))
                    {
                        e.Url = value;
                    }
                }
            }
        }
Пример #2
0
 private void fastObjectListView_main_IsHyperlink(object sender, IsHyperlinkEventArgs e)
 {
     if (e.Column.Text.Contains("链接"))
     {
         e.Url = e.Text;
     }
 }
Пример #3
0
 private void fastObjectListView1_IsHyperlink(object sender, IsHyperlinkEventArgs e)
 {
     if (e.Text.Contains("员"))
     {
         e.Url = "http://www.baidu.com";
     }
     else
     {
         e.Url = "http://www.google.com";
     }
 }
Пример #4
0
 protected override void OnIsHyperlink(IsHyperlinkEventArgs e)
 {
     if (IsMultiValuedField((RowObject)e.Model))
     {
         e.Url = null;
     }
     else
     {
         base.OnIsHyperlink(e);
     }
 }
        private void olvValidations_IsHyperlink(object sender, IsHyperlinkEventArgs e)
        {
            var selectedValidation = e.Model as Validation;

            if (selectedValidation != null &&
                selectedValidation.helpUrl?.Length > 0)
            {
                e.Url = selectedValidation.helpUrl;
            }
            else
            {
                e.IsHyperlink = false;
            }
        }
        private void olvChecks_IsHyperlink(object sender, IsHyperlinkEventArgs e)
        {
            var selectedCheck = e.Model as Check;

            if (selectedCheck != null &&
                selectedCheck.helpUrl?.Length > 0)
            {
                e.Url = selectedCheck.helpUrl;
            }
            else
            {
                e.IsHyperlink = false;
            }
        }
Пример #7
0
        private void objLVDashboard_IsHyperlink(object sender, IsHyperlinkEventArgs e)
        {
            if (e.Model == null)
            {
                return;
            }
            DashboardReportItem item = (DashboardReportItem)e.Model;

            if (!item.GetReportItemDecoration().IsHyperLink)
            {
                e.IsHyperlink = false;
                e.Url         = null;
            }
        }
Пример #8
0
 private void folvAnime_IsHyperlink(object sender, IsHyperlinkEventArgs e)
 {
     e.Url = e.Text;
 }