Skip to content

Commit

Permalink
Added TryGet method overload to the VideoPickerProviderCollection class
Browse files Browse the repository at this point in the history
The overload allows getting the provider as a specific type instead of just IVideoProvider
abjerner committed Oct 5, 2021
1 parent b65505e commit 9384532
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -23,6 +23,11 @@ public bool TryGet(string alias, out IVideoProvider provider) {
return provider != null;
}

public bool TryGet<TVideoProvider>(out TVideoProvider provider) where TVideoProvider : IVideoProvider {
provider = this.OfType<TVideoProvider>().FirstOrDefault();
return provider != null;
}

}

}

0 comments on commit 9384532

Please sign in to comment.