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
// Example 1: Dictionaries. | |
// Using "string" as key/value for example; could be anything. | |
IDictionary<string, string> myDictionary; | |
// ... | |
// ... | |
// Returns Perhaps<string>.NotThere if not found. | |
var dictionaryResult = myDictionary.LookFor("MyKey"); |
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
private class AssemblyEqualityComparer : IEqualityComparer<Assembly> | |
{ | |
public bool Equals(Assembly x, Assembly y) | |
{ | |
return x.FullName == y.FullName; | |
} | |
public int GetHashCode(Assembly obj) | |
{ | |
return obj.GetHashCode(); |
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
var assemblyFiles = new List<string>(); | |
foreach (var modulesDirectory in modulesDirectories) | |
{ | |
using (var directoryCatalog = new DirectoryCatalog(modulesDirectory)) | |
assemblyFiles.AddRange(directoryCatalog.LoadedFiles); | |
} | |
var assemblyCatalogs = assemblyFiles | |
.Distinct() | |
.Select(Assembly.LoadFrom) |