Пример #1
0
        private Assembly MockEditorPlugin_MapToAssemblyCallback(MockEditorPlugin mockPlugin)
        {
            // We'll just map the newly instantiated core plugin to any of the assemblies
            // we're mock-providing, except the ones that are already mapped
            Assembly assembly;

            if (!this.pluginMap.TryGetValue(mockPlugin, out assembly))
            {
                assembly = this.assemblyMap
                           .Where(pair => !this.pluginMap.ContainsValue(pair.Value))
                           .Where(pair => pair.Key.EndsWith(".editor.dll", StringComparison.InvariantCultureIgnoreCase))
                           .Select(pair => pair.Value)
                           .FirstOrDefault();
                this.pluginMap.Add(mockPlugin, assembly);
            }
            return(assembly);
        }
Пример #2
0
 private Assembly MockEditorPlugin_MapToAssemblyCallback(MockEditorPlugin mockPlugin)
 {
     // We'll just map the newly instantiated core plugin to any of the assemblies
     // we're mock-providing, except the ones that are already mapped
     Assembly assembly;
     if (!this.pluginMap.TryGetValue(mockPlugin, out assembly))
     {
         assembly = this.assemblyMap
             .Where(pair => !this.pluginMap.ContainsValue(pair.Value))
             .Where(pair => pair.Key.EndsWith(".editor.dll", StringComparison.InvariantCultureIgnoreCase))
             .Select(pair => pair.Value)
             .FirstOrDefault();
         this.pluginMap.Add(mockPlugin, assembly);
     }
     return assembly;
 }