Skip to content

Commit

Permalink
Match against GAC assembly version
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsck committed Oct 17, 2016
1 parent 0f9c945 commit e4d68ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions dnSpy/dnSpy/Documents/Tabs/Dialogs/GACFileVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ sealed class GACFileVM : ViewModelBase {
public IAssembly Assembly => gacFileInfo.Assembly;
public OpenFromGACVM Owner { get; }

public string VersionString => versionString ?? (versionString = (Version ?? new Version(0, 0, 0, 0)).ToString());
string versionString;

public string CreatedBy {
get {
if (createdBy == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public IEnumerable<TextClassificationTag> GetTags(TextClassifierContext context)
var gacContext = context as OpenFromGACTextClassifierContext;
if (gacContext == null)
yield break;
if (gacContext.Tag != PredefinedTextClassifierTags.GacDialogName)
if (gacContext.Tag != PredefinedTextClassifierTags.GacDialogName && gacContext.Tag != PredefinedTextClassifierTags.GacDialogVersion)
yield break;
foreach (var part in gacContext.SearchText.Split(seps, StringSplitOptions.RemoveEmptyEntries)) {
int index = gacContext.Text.IndexOf(part, StringComparison.CurrentCultureIgnoreCase);
Expand Down
3 changes: 2 additions & 1 deletion dnSpy/dnSpy/Documents/Tabs/Dialogs/OpenFromGACVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ bool CalculateIsVisible(GACFileVM vm, string filterText) {
if (string.IsNullOrEmpty(filterText))
return true;
var name = vm.Name.ToUpperInvariant();
var version = vm.VersionString.ToUpperInvariant();
foreach (var s in filterText.ToUpperInvariant().Split(sep, StringSplitOptions.RemoveEmptyEntries)) {
if (!name.Contains(s))
if (!name.Contains(s) && !version.Contains(s))
return false;
}
return true;
Expand Down

0 comments on commit e4d68ae

Please sign in to comment.