-
Notifications
You must be signed in to change notification settings - Fork 746
Show Package Owner profile links on Browse Tab #5766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
|
||
| using System; | ||
| using System.Diagnostics; | ||
| using System.Globalization; | ||
| using System.Windows; | ||
| using System.Windows.Data; | ||
|
|
||
| namespace NuGet.PackageManagement.UI | ||
| { | ||
| internal class LastItemToVisibilityConverter : IMultiValueConverter | ||
| { | ||
| public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) | ||
| { | ||
| if (values != null && values.Length == 2 | ||
| && values[0] is int currentIndex | ||
| && values[1] is int length) | ||
| { | ||
| if (currentIndex < 0 || length < 1 || currentIndex >= length) | ||
| { | ||
| return DependencyProperty.UnsetValue; | ||
| } | ||
|
|
||
| int lastIndex = length - 1; | ||
| return Equals(currentIndex, lastIndex) ? Visibility.Collapsed : Visibility.Visible; | ||
| } | ||
|
|
||
| return DependencyProperty.UnsetValue; | ||
| } | ||
|
|
||
| public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) | ||
| { | ||
| Debug.Fail("Not Implemented"); | ||
| return null; | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
|
||
| using System; | ||
| using NuGet.VisualStudio.Internal.Contracts; | ||
|
|
||
| namespace NuGet.PackageManagement.UI.ViewModels | ||
| { | ||
| public class KnownOwnerViewModel | ||
| { | ||
| private string _name; | ||
| private Uri _link; | ||
|
|
||
| public KnownOwnerViewModel(KnownOwner knownOwner) | ||
| { | ||
| _name = knownOwner.Name; | ||
| _link = knownOwner.Link; | ||
| } | ||
|
|
||
| public string Name => _name; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. public string Name {get;} is syntactic sugar over having a private and public field.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, I created a field at some point during development, but it's not really necessary, I'll revise that. |
||
|
|
||
| public Uri Link => _link; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.