public void ConfigureFamily(TypePath pluginTypePath, Action <PluginFamily> action) { var pluginType = pluginTypePath.FindType(); var family = _pluginGraph.Families[pluginType]; action(family); }
public void can_parse_assembly_qualified_generics() { Type sampleGenericType = typeof (IConcept<AWidget>); string genericAssemblyQualifiedName = sampleGenericType.AssemblyQualifiedName; var path = new TypePath(genericAssemblyQualifiedName); path.FindType().ShouldEqual(sampleGenericType); }
public DoctorReport RunReport(string bootstrapperTypeName) { var report = new DoctorReport { Result = DoctorResult.Success }; IBootstrapper bootstrapper; try { var path = new TypePath(bootstrapperTypeName); Type bootstrapperType = path.FindType(); bootstrapper = (IBootstrapper)Activator.CreateInstance(bootstrapperType); } catch (Exception e) { report.Result = DoctorResult.BootstrapperCouldNotBeFound; report.ErrorMessages = e.ToString(); return(report); } try { bootstrapper.BootstrapStructureMap(); PluginGraph graph = ObjectFactory.PluginGraph; if (graph.Log.ErrorCount > 0) { report.ErrorMessages = graph.Log.BuildFailureMessage(); report.Result = DoctorResult.ConfigurationErrors; } else { writeConfigurationAndValidate(report, graph); } return(report); } catch (StructureMapConfigurationException ex) { report.ErrorMessages = ex.Message; report.Result = DoctorResult.ConfigurationErrors; return(report); } catch (Exception ex) { report.Result = DoctorResult.BootstrapperFailure; report.ErrorMessages = ex.ToString(); return(report); } }
public void can_parse_assembly_qualified_generics() { var sampleGenericType = typeof(IConcept <AWidget>); var genericAssemblyQualifiedName = sampleGenericType.AssemblyQualifiedName; var path = new TypePath(genericAssemblyQualifiedName); path.FindType().ShouldEqual(sampleGenericType); }
public void ConfigureFamily(TypePath pluginTypePath, Action <PluginFamily> action) { try { Type pluginType = pluginTypePath.FindType(); PluginFamily family = _pluginGraph.FindFamily(pluginType); action(family); } catch (Exception ex) { _pluginGraph.Log.RegisterError(103, ex, pluginTypePath.AssemblyQualifiedName); } }
public void WithType(TypePath path, string context, Action <Type> action) { try { Type type = path.FindType(); action(type); } catch (StructureMapException ex) { RegisterError(ex); } catch (Exception ex) { RegisterError(131, ex, path.AssemblyQualifiedName, context); } }
public static void WithType(this GraphLog log, TypePath path, string context, Action<Type> action) { try { Type type = path.FindType(); action(type); } catch (StructureMapException ex) { log.RegisterError(ex); } catch (Exception ex) { log.RegisterError(131, ex, path.AssemblyQualifiedName, context); } }
public void CanBuildTypeCreatedFromType() { var path = new TypePath(GetType()); path.FindType(); }
public void CanBuildTypeCreatedFromType() { var path = new TypePath(GetType()); path.FindType(); }
public void ConfigureFamily(TypePath pluginTypePath, Action<PluginFamily> action) { try { Type pluginType = pluginTypePath.FindType(); PluginFamily family = _pluginGraph.FindFamily(pluginType); action(family); } catch (Exception ex) { _pluginGraph.Log.RegisterError(103, ex, pluginTypePath.AssemblyQualifiedName); } }