forked from chocolatey/ChocolateyGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/2.1.0: (maint) Update to latest version of chocolatey.lib (maint) Update GRM configuration file (maint) Remove version bump in nuspec file (build) Use latest Chocolatey.Cake.Recipe package (maint) Switch to Http for variable names (chocolatey#1014) Add advanced option to ignore cached items (chocolatey#1014) Ignore cached files on forced outdated check (build) Make build files consistent with others (chocolatey#993) (fix) Correct syntax in KTS file (chocolatey#993) Add TC schedule trigger (maint) Fix StyleCop warnings (chocolatey#980) Use assembly location when debugging (maint) Update to released alpha package (chocolatey#1003) Handle null keys during source translation (chocolatey#1005) Normalize version numbers (maint) Add banned api analyzer (maint) Remove usage of obsolete methods (maint) Update to latest Chocolatey.Lib package
- Loading branch information
Showing
32 changed files
with
287 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
Source/ChocolateyGui.Common.Windows/Utilities/Converters/NuGetVersionToString.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright company="Chocolatey" file="NuGetVersionToString.cs"> | ||
// Copyright 2017 - Present Chocolatey Software, LLC | ||
// Copyright 2014 - 2017 Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace ChocolateyGui.Common.Windows.Utilities.Converters | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using chocolatey; | ||
using NuGet.Versioning; | ||
|
||
public class NuGetVersionToString : DependencyObject, IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is NuGetVersion version) | ||
{ | ||
return version.ToNormalizedStringChecked(); | ||
} | ||
|
||
return value; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is string sValue && NuGetVersion.TryParse(sValue, out var version)) | ||
{ | ||
return version; | ||
} | ||
|
||
throw new InvalidOperationException("The passed in value is not a parseable string version!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.