public IDisposable Subscribe <T>(ActionIn <T> action) { Action = action; ++SubscribeCount; return(null); }
public static void InitFromProcessParameters<T>(T obj, System.Collections.Generic.IEnumerator<string> enumerator) where T : ArchiveProcessParameters { ThrowIfNull(obj, nameof(obj)); ThrowIfNull(enumerator, nameof(enumerator)); System.Reflection.PropertyInfo[] enumerable = obj.GetType().GetProperties(); try { ActionIn<System.Reflection.PropertyInfo> action = _action; void _action(in System.Reflection.PropertyInfo _p) { void __action(in System.Reflection.PropertyInfo __p) { if (enumerator.MoveNext()) __p.SetValue(obj, typeof(Enum).IsAssignableFrom(__p.PropertyType) ? Enum.Parse(__p.PropertyType, enumerator.Current) : Convert.ChangeType(enumerator.Current, __p.PropertyType)); else throw new InvalidOperationException(ProcessParametersCouldNotBeParsedCorrectly); } if (_p.Name == nameof(Guid)) { action = __action; _ = enumerator.MoveNext(); return; } __action(_p); } foreach (System.Reflection.PropertyInfo p in enumerable) action(p); } catch (Exception ex) when (ex.Is(false, typeof(InvalidCastException), typeof(FormatException), typeof(OverflowException), typeof(ArgumentNullException))) { throw new InvalidOperationException(ProcessParametersCouldNotBeParsedCorrectly, ex); } }
public Subscription(int worldId, ActionIn <T> action) { _worldId = worldId; _action = action; }
public IDisposable Subscribe <T>(ActionIn <T> action) { return(globalEcsContext.Subscribe <T>(action)); }
public CommandHandler(ActionIn <T> handler) { _handler = handler; }
public StateDefinitionBuilder Do(ActionIn <TCommand> handle) { _stateDefinitionBuilder.AddHandler(handle); return(_stateDefinitionBuilder); }
private void AddHandler <TCommand>(ActionIn <TCommand> handler) => _configuration.CommandHandlers.Add( CommandTypeId <TCommand> .Value, new CommandHandler <TCommand>(handler) );