public AttributeImpl( [NotNull] IAttributeDescriptor descriptor, [NotNull] Attribute attribute, [NotNull] IReflection reflection) { if (descriptor == null) { throw new ArgumentNullException(nameof(descriptor)); } if (attribute == null) { throw new ArgumentNullException(nameof(attribute)); } if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } var type = attribute.GetType(); Descriptor = descriptor; var typeInfo = reflection.CreateType(type); _properties = ( from property in typeInfo.Properties select new { name = property.Name, value = property.GetValue(attribute) }).ToDictionary(i => i.name, i => i.value); }
public Binding(Type k) { m_TypeK = k; reflection = new Reflection(); _dicName2Obj = new Dictionary <string, object>(); _dicName2Single = new Dictionary <string, bool>(); }
public NHibernateSagaPersister(INHibernateSessionProvider session, IServiceLocator serviceLocator, IMessageSerializer messageSerializer, IReflection reflection) { this.session = session.CurrentSession; this.serviceLocator = serviceLocator; this.messageSerializer = messageSerializer; this.reflection = reflection; }
public XmlMessageSerializer(IReflection reflection, IKernel kernel ) { this.reflection = reflection; this.kernel = kernel; customElementSerializers = this.kernel.ResolveAll<ICustomElementSerializer>(); elementSerializationBehaviors = this.kernel.ResolveAll<IElementSerializationBehavior>(); }
public DataDictionarySeederController(IReflection reflectionHelper, string assemblyName) { assemblyName.Guard("AssemblyName must not be empty or null."); reflectionHelper.Guard("ReflectionHelper must not be null."); _reflectionHelper = reflectionHelper; _assemblyName = assemblyName; }
public XmlMessageSerializer(IReflection reflection, IServiceLocator serviceLocator ) { this.reflection = reflection; this.serviceLocator = serviceLocator; customElementSerializers = this.serviceLocator.ResolveAll<ICustomElementSerializer>().ToArray(); elementSerializationBehaviors = this.serviceLocator.ResolveAll<IElementSerializationBehavior>().ToArray(); }
public XmlMessageSerializer(IReflection reflection, IServiceLocator serviceLocator) { this.reflection = reflection; this.serviceLocator = serviceLocator; customElementSerializers = this.serviceLocator.ResolveAll <ICustomElementSerializer>().ToArray(); elementSerializationBehaviors = this.serviceLocator.ResolveAll <IElementSerializationBehavior>().ToArray(); }
public XmlMessageSerializer(IReflection reflection, IKernel kernel) { this.reflection = reflection; this.kernel = kernel; customElementSerializers = this.kernel.ResolveAll <ICustomElementSerializer>(); elementSerializationBehaviors = this.kernel.ResolveAll <IElementSerializationBehavior>(); }
private static void RegisterSingles<T>(IReflection reflection, ContainerBuilder builder) { var objTypes = reflection.AssignableTypes<T>(); foreach (var objType in objTypes) { builder.RegisterType(objType).AsSelf().InstancePerDependency(); } }
private static void RegisterSinglesAs(IReflection reflection, ContainerBuilder builder) { var injectablesAsEnumerable = reflection.AssignableTypes<Common.Modules.IInjectableAsEnumerable>(); foreach (var injectable in injectablesAsEnumerable) { builder.RegisterType(injectable).As(reflection.GetBaseType(injectable)).SingleInstance(); } }
public SingletonManager(IReflection reflection, ILogger logger, IFactory factory) { Argument.NotNull(() => logger); Argument.NotNull(() => factory); this.logger = logger; this.factory = factory; this.Singletons = new object[0]; }
public SingletonScanner(IReflection reflection, ILogger logger, ISingletonManager singletonManager) { Argument.NotNull(() => reflection); Argument.NotNull(() => logger); Argument.NotNull(() => singletonManager); this.reflection = reflection; this.logger = logger; this.singletonManager = singletonManager; }
public LookupFactory(IReflection helper, IUnitOfWork unitOfWork, string assemblyName) { assemblyName.Guard("AssemblyName must not be null"); unitOfWork.Guard("UnitOfWork must not be null."); helper.Guard("ReflectionHelper must not be null."); _helper = helper; _unitOfWork = unitOfWork; _assemblyName = assemblyName; }
public FileSubscriptionStorage( string subscriptionPath, IMessageSerializer messageSerializer, IReflection reflection) { _subscriptionPath = subscriptionPath; _messageSerializer = messageSerializer; _reflection = reflection; _pht = new HashTable(subscriptionPath); }
public PhtSubscriptionStorage( string subscriptionPath, IMessageSerializer messageSerializer, IReflection reflection) { this.subscriptionPath = subscriptionPath; this.messageSerializer = messageSerializer; this.reflection = reflection; pht = new PersistentHashTable.PersistentHashTable(subscriptionPath); }
public GenericSubscriptionStorage( IStorage storage, string localEndpoint, IMessageSerializer messageSerializer, IReflection reflection) { this.storage = storage; this.localEndpoint = localEndpoint; this.messageSerializer = messageSerializer; this.reflection = reflection; }
static DI() { log = PublicDI.log; // _note that when the O2GuiWithDockPanel is create it will overide the PublicDI log with WinFormsUILog() object reflection = PublicDI.reflection; config = PublicDI.config; o2MessageQueue = KO2MessageQueue.getO2KernelQueue(); new O2MessagesHandler(); // set up O2Message hook autoAddLogViewerToGui = true; }
public Factory(string name, ILogger logger) { Argument.StringNotNullOrEmpty(() => name); Argument.NotNull(() => logger); this.Name = name; this.logger = logger; this.reflection = new Reflection(); this.Dep <IFactory>(this); }
public MsmqSubscriptionStorage( IReflection reflection, IMessageSerializer messageSerializer, Uri subscriptionQueue, IQueueStrategy queueStrategy ) { this.reflection = reflection; this.messageSerializer = messageSerializer; this.queueStrategy = queueStrategy; this.subscriptionQueue = this.queueStrategy.CreateSubscriptionQueueUri(subscriptionQueue); }
public LinkedCascadeData(IReflection helper, IUnitOfWork unitOfWork, string entityModelType, string domainAssemblyName) { helper.Guard("ReflectionHelper must not be null."); unitOfWork.Guard("UnitOfWork must nit be null."); entityModelType.Guard("TypeName must not be null or empty."); domainAssemblyName.Guard("DomainAssemblyName must not be null or empty."); _helper = helper; _unitOfWork = unitOfWork; _entityModelType = entityModelType; _domainAssemblyName = domainAssemblyName; }
public PropertyInfoImpl( [NotNull] IReflection reflection, [NotNull] PropertyInfo property) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (property == null) { throw new ArgumentNullException(nameof(property)); } _property = property; }
public MsmqSubscriptionStorage( IReflection reflection, IMessageSerializer messageSerializer, Uri queueBusListensTo, IEndpointRouter endpointRouter, IQueueStrategy queueStrategy ) { this.reflection = reflection; this.messageSerializer = messageSerializer; this.endpointRouter = endpointRouter; this.queueStrategy = queueStrategy; this.subscriptionQueue = this.queueStrategy.CreateSubscriptionQueueUri(queueBusListensTo); }
public Factory(string name, IFactory fallbackFactory, ILogger logger, IReflection reflection) { Argument.StringNotNullOrEmpty(() => name); Argument.NotNull(() => fallbackFactory); Argument.NotNull(() => logger); Argument.NotNull(() => reflection); this.Name = name; this.fallbackFactory = fallbackFactory; this.logger = logger; this.reflection = reflection; this.Dep <IFactory>(this); }
public AssemblyInfoImpl( [NotNull] IReflection reflection, [NotNull] Assembly assembly) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (assembly == null) { throw new ArgumentNullException(nameof(assembly)); } _reflection = reflection; _assembly = assembly; }
public ParameterInfoImpl( [NotNull] IReflection reflection, [NotNull] ParameterInfo parameterInfo) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (parameterInfo == null) { throw new ArgumentNullException(nameof(parameterInfo)); } _reflection = reflection; _parameterInfo = parameterInfo; }
public AttributeAccessor( [NotNull] IReflection reflection, [NotNull] Func <IAttributeDescriptor, Attribute, IAttribute> attributeFactory) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (attributeFactory == null) { throw new ArgumentNullException(nameof(attributeFactory)); } _reflection = reflection; _attributeFactory = attributeFactory; }
public MethodInfoImpl( [NotNull] IReflection reflection, [NotNull] MethodInfo methodInfo) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (methodInfo == null) { throw new ArgumentNullException(nameof(methodInfo)); } _reflection = reflection; _methodInfo = methodInfo; }
public static ReflectionDto ToDto(this IReflection reflection) { var dto = new ReflectionDto { Mirror = reflection.Mirror.ToDto(), Id = reflection.Id, DateTime = reflection.DateTime, TargetRevision = reflection.TargetRevision.ToDto(), SourceRevision = reflection.SourceRevision.ToDto(), Synchronization = reflection.Synchronization.ToDto(), MirrorId = reflection.Mirror.Id, SynchronizationId = reflection.Synchronization.Id }; return(dto); }
public DefaultServiceBus( IServiceLocator serviceLocator, ITransport transport, ISubscriptionStorage subscriptionStorage, IReflection reflection, IMessageModule[] modules, MessageOwner[] messageOwners, IEndpointRouter endpointRouter) { this.transport = transport; this.endpointRouter = endpointRouter; this.messageOwners = new MessageOwnersSelector(messageOwners, endpointRouter); this.subscriptionStorage = subscriptionStorage; this.reflection = reflection; this.modules = modules; this.serviceLocator = serviceLocator; }
public Discoverer( [NotNull] IReflection reflection, [NotNull] IAttributeMap attributeMap, [NotNull] IAttributeAccessor attributeAccessor, [NotNull] IGenericArgsProvider genericArgsProvider, [NotNull] IArgsProvider argsProvider, [NotNull] Func <ITestInfo, ICase> caseFactory, [NotNull] IRunner runner) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (attributeMap == null) { throw new ArgumentNullException(nameof(attributeMap)); } if (attributeAccessor == null) { throw new ArgumentNullException(nameof(attributeAccessor)); } if (genericArgsProvider == null) { throw new ArgumentNullException(nameof(genericArgsProvider)); } if (argsProvider == null) { throw new ArgumentNullException(nameof(argsProvider)); } if (caseFactory == null) { throw new ArgumentNullException(nameof(caseFactory)); } if (runner == null) { throw new ArgumentNullException(nameof(runner)); } _reflection = reflection; _attributeMap = attributeMap; _attributeAccessor = attributeAccessor; _genericArgsProvider = genericArgsProvider; _argsProvider = argsProvider; _caseFactory = caseFactory; _runner = runner; }
public TypeInfoImpl( [NotNull] IReflection reflection, [NotNull] Type type) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (type == null) { throw new ArgumentNullException(nameof(type)); } _reflection = reflection; _type = type; #if !NET35 && !NET40 _typeInfo = type.GetTypeInfo(); #endif }
public ArgsProvider( [NotNull] IReflection reflection, [NotNull] IAttributeMap attributeMap, [NotNull] IAttributeAccessor attributeAccessor) { if (reflection == null) { throw new ArgumentNullException(nameof(reflection)); } if (attributeMap == null) { throw new ArgumentNullException(nameof(attributeMap)); } if (attributeAccessor == null) { throw new ArgumentNullException(nameof(attributeAccessor)); } _reflection = reflection; _attributeMap = attributeMap; _attributeAccessor = attributeAccessor; }
/// <summary> /// Helper function to search for and auto-register factory types. /// Mockable interfaces are passed in for testing. /// </summary> public static void AutoRegisterTypes(IReflection reflection, IFactory factory) { Argument.NotNull(() => reflection); Argument.NotNull(() => factory); // Add factory creatable definitions var factoryCreatableTypes = reflection.FindTypesMarkedByAttributes(new Type[] { typeof(FactoryCreatableAttribute) }); foreach (var factoryCreatableType in factoryCreatableTypes) { var attributes = reflection.GetAttributes <FactoryCreatableAttribute>(factoryCreatableType); foreach (var attribute in attributes) { var name = attribute.TypeName; if (string.IsNullOrEmpty(name)) { name = factoryCreatableType.Name; } factory.Type(name, factoryCreatableType); } } }
private void mainForm_Load(object sender, EventArgs e) { var files = Directory.GetFiles("Modules", "*.dll", SearchOption.TopDirectoryOnly); foreach (var file in files) { Assembly myAssembly = Assembly.LoadFrom(file); Type type = myAssembly.GetTypes().Where(t => t.IsClass && t.GetInterface(typeof(IReflection).ToString()) == typeof(IReflection)).First(); if (type == null) { continue; } IReflection r = (IReflection)Activator.CreateInstance(type); UserControl uc = r.GetControl(); uc.Dock = DockStyle.Fill; mainMenuStrip.Items.Add(r.Caption, null, (o, args) => { foreach (Control control in Controls) { if (control != uc && control != mainMenuStrip) { Controls.Remove(control); } } if (!Controls.Contains(uc)) { Controls.Add(uc); } }); } }
public ScopeClosure(Environment scope, IReflection reflection) { _reflection = reflection; _scope = scope; }
public SingletonManager(IReflection reflection, ILogger logger, IFactory factory) { Argument.NotNull(() => reflection); Argument.NotNull(() => logger); Argument.NotNull(() => factory); this.reflection = reflection; this.logger = logger; this.factory = factory; this.Singletons = new object[0]; }
static DI() { config = PublicDI.config; log = PublicDI.log; reflection = PublicDI.reflection; }
static DI() { config = PublicDI.config; // need to use local copy log = PublicDI.log; reflection = PublicDI.reflection; }
public JsonSerializer(IReflection reflection) { this.reflection = reflection; }
public XmlMessageSerializer(IReflection reflection, IKernel kernel ) { this.reflection = reflection; this.kernel = kernel; }