public void RandomizeEventCollection(IEventCollection eventCollection) { foreach (var nEvent in eventCollection.MappedObjectReadOnly) { RandomizeEvent(nEvent); } }
public TypeMemberCollection() { _fields = new FieldCollection(); _methods = new MethodCollection(); _properties = new PropertyCollection(); _events = new EventCollection(); }
//[JsonConstructor] public Customer(string custId, string userName, string passWord, IInvitationCollection invitations, IEventCollection events) : base(custId) { this.userName = userName; this.passWord = passWord; this.invitations = invitations; this.events = events; }
/// <summary> /// Subscribes a new handler for the given <typeparamref name="TEvent"/> type. /// </summary> /// <typeparam name="TEvent">The type of event to subscribe and handler for.</typeparam> /// <param name="eventCollection">The event collections.</param> /// <param name="handler">The handler to subscribe to the event.</param> public static void Subscribe <TEvent>(this IEventCollection eventCollection, EventHandler <TEvent> handler) { _ = eventCollection ?? throw new ArgumentNullException(nameof(eventCollection)); _ = handler ?? throw new ArgumentNullException(nameof(handler)); eventCollection.Subscribe((AsyncEventHandler <TEvent>)(args => { handler(args); return(Task.CompletedTask); })); }
private void InitMembers() { if (_members != null) { return; } _fields = new FieldList(this); _properties = new PropertyList(this); _events = new EventList(this); _methods = new MethodList(this); _members = new TypeMemberCollection(_fields, _methods, _properties, _events); }
public TypeMemberCollection(IFieldCollection fields, IMethodCollection methods, IPropertyCollection properties, IEventCollection events) { if (fields == null) { throw new ArgumentNullException("fields"); } if (methods == null) { throw new ArgumentNullException("methods"); } if (properties == null) { throw new ArgumentNullException("properties"); } if (events == null) { throw new ArgumentNullException("events"); } _fields = fields; _methods = methods; _properties = properties; _events = events; }
public EventCollectionHandlerCollection(IEventCollection <TKey, TValue> collection) { this.collection = collection; internalHandlers = new List <KeyValuePair <object, IEventCollectionHandler <TKey, TValue> > >(); }
public ContextWrapped(IEventCollection <TKey, TValue> collection, object context) { this.collection = collection; this.context = context; }