Exemplo n.º 1
0
 public void SetupTypes()
 {
     _typeMapping.Add("IdentityMapperHandler", typeof(IdentityMapperHandler));
     _typeMapping.Add("EdgeHubDataPointReceived", typeof(Events.EdgeHubDataPointReceived));
     _typeMapping.Add("EdgeHubDataPointRemapped", typeof(Events.EdgeHubDataPointRemapped));
     _typeMapping.Add("EdgeHubDataPointWithSource", typeof(Events.EdgeHubDataPointWithSource));
 }
Exemplo n.º 2
0
 public void SetupTypes()
 {
     _typeMapping.Add("NMEALineHandler", typeof(NMEALineHandler));
     _typeMapping.Add("StateHandler", typeof(StateHandler));
     _typeMapping.Add("NMEASentenceReceived", typeof(Events.NMEASentenceReceived));
     _typeMapping.Add("EventParsed", typeof(Events.EventParsed));
     _typeMapping.Add("NMEADatapointOutput", typeof(Events.NMEADatapointOutput));
 }
 public EventStoreSagaRepository(IEventStoreConnection connection)
 {
     _connection = connection;
     if (TypeMapping.GetTypeName(typeof(EventSourcedSagaInstance.SagaInstanceTransitioned)).Contains("+"))
     {
         TypeMapping.Add <EventSourcedSagaInstance.SagaInstanceTransitioned>("SagaInstanceTransitioned");
     }
 }
		/// <summary>
		/// Adds <see cref="PropertyMapping"/>s of <paramref name="property"/> to the given <paramref name="typeMapping"/>.
		/// </summary>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="property">The <see cref="IPropertyDefinition"/> of the property for which to add the <see cref="PropertyMapping"/>s.</param>
		/// <param name="typeMapping">The <see cref="TypeMapping"/> to which to add the new <see cref="PropertyMapping"/>s.</param>
		protected override void DoAddMappingTo(IMansionContext context, IPropertyDefinition property, TypeMapping typeMapping)
		{
			typeMapping.Add(new SingleValuedPropertyMapping("approved")
			                {
			                	Type = "boolean"
			                });
			typeMapping.Add(new SingleValuedPropertyMapping("archived")
			                {
			                	Type = "boolean"
			                });
			typeMapping.Add(new SingleValuedPropertyMapping("publicationDate")
			                {
			                	Type = "date"
			                });
			typeMapping.Add(new SingleValuedPropertyMapping("expirationDate")
			                {
			                	Type = "date"
			                });
		}
Exemplo n.º 5
0
        public V2DynamoDbSagaRepository(IDynamoDBContext connection, DynamoDbEventStoreOptions options, KnownEventTypes knownTypes)
        {
            _connection = connection ?? throw new ArgumentNullException(nameof(connection));
            _options    = options ?? throw new ArgumentNullException(nameof(options));
            _knownTypes = knownTypes ?? throw new ArgumentNullException(nameof(knownTypes));

            if (TypeMapping.GetTypeName(typeof(V2EventSourcedSagaInstance.SagaInstanceTransitioned)).Contains("+"))
            {
                TypeMapping.Add <V2EventSourcedSagaInstance.SagaInstanceTransitioned>("SagaInstanceTransitioned");
            }
        }
Exemplo n.º 6
0
        public EventStoreSagaRepository(
            IEventStoreConnection connection, GetEventMetadata <TSaga> getEventMetadata = null
            )
        {
            _connection       = connection;
            _getEventMetadata = getEventMetadata ?? DefaultMetadataFactory;
            _assemblyName     = typeof(TSaga).Assembly.GetName().Name;

            if (TypeMapping.GetTypeName(typeof(EventSourcedSagaInstance.SagaInstanceTransitioned)).Contains("+"))
            {
                TypeMapping.Add <EventSourcedSagaInstance.SagaInstanceTransitioned>("SagaInstanceTransitioned");
            }
        }
Exemplo n.º 7
0
        /// <summary>
        ///     Adds the specified mapping info to the internal mappings table.
        /// </summary>
        /// <param name="mappingInfo">The mapping info targetProperty be added.</param>
        protected void AddMappingInfo(MemberMappingInfo <TSource, TTarget> mappingInfo)
        {
            if (CurrentStatus == MapperStatus.Active)
            {
                throw new InvalidOperationException("Cannot add mappings to an already active mapper");
            }
            if (CurrentStatus == MapperStatus.New)
            {
                CurrentStatus = MapperStatus.Initialized;
            }

            TypeMapping.Add(mappingInfo);
        }
Exemplo n.º 8
0
        public DynamoDbSagaRepository(IDynamoDBContext connection, DynamoDbEventStoreOptions options, KnownEventTypes knownTypes)
        {
            _connection = connection ?? throw new ArgumentNullException(nameof(connection));
            _knownTypes = knownTypes ?? throw new ArgumentNullException(nameof(knownTypes));

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _configuration = new DynamoDBOperationConfig {
                OverrideTableName = options.StoreName, Conversion = DynamoDBEntryConversion.V2
            };

            if (TypeMapping.GetTypeName(typeof(EventSourcedSagaInstance.SagaInstanceTransitioned)).Contains("+"))
            {
                TypeMapping.Add <EventSourcedSagaInstance.SagaInstanceTransitioned>("SagaInstanceTransitioned");
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Initializes the card manager.
        /// Scan all application assemblies for MonoBehaviours implementing CartyLib.ICardType.
        /// </summary>
        public void Initialize()
        {
            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                Type[] types = null;

                try
                {
                    types = assembly.GetTypes();
                }
                catch (ReflectionTypeLoadException ex)
                {
                    Debug.LogError("Failed to load types from: " + assembly.FullName);
                    foreach (Exception loadEx in ex.LoaderExceptions)
                    {
                        Debug.LogException(loadEx);
                    }
                }

                if (types == null)
                {
                    continue;
                }

                foreach (Type type in types)
                {
                    if (type.GetInterfaces().Contains(typeof(ICardType)) && type.BaseType == typeof(MonoBehaviour))
                    {
                        GameObject obj = new GameObject();

                        string id = (obj.AddComponent(type) as ICardType).GetInfo().UniqueCardTypeId;
                        TypeMapping.Add(id, type);
                        GameObject.Destroy(obj);
                    }
                }
            }
        }
Exemplo n.º 10
0
 public void SetupTypes()
 {
     _typeMapping.Add("TerasakiLineHandler", typeof(TerasakiLineHandler));
     _typeMapping.Add("TcpLineReceived", typeof(Events.TcpLineReceived));
     _typeMapping.Add("TerasakiDatapointOutput", typeof(Events.TerasakiDatapointOutput));
 }
Exemplo n.º 11
0
 public void SetupTypes()
 {
     _typeMapping.Add("ModbusRegisterReceivedHandler", typeof(ModbusRegisterReceivedHandler));
     _typeMapping.Add("ModbusRegisterReceived", typeof(Events.ModbusRegisterReceived));
     _typeMapping.Add("ModbusDatapointOutput", typeof(Events.ModbusDatapointOutput));
 }
Exemplo n.º 12
0
 public void SetupTypes()
 {
     _typeMapping.Add("KymaLineHandler", typeof(KymaLineHandler));
     _typeMapping.Add("KymaSentenceReceived", typeof(Events.KymaSentenceReceived));
     _typeMapping.Add("KymaDatapointOutput", typeof(Events.KymaDatapointOutput));
 }
Exemplo n.º 13
0
 public void SetupTypes()
 {
     _typeMapping.Add("ParserHandler", typeof(ParserHandler));
     _typeMapping.Add("MqttEventReceived", typeof(Events.MqttEventReceived));
     _typeMapping.Add("LoraDatapointOutput", typeof(Events.LoraDatapointOutput));
 }