public void RandomizeEventCollection(IEventCollection eventCollection)
 {
     foreach (var nEvent in eventCollection.MappedObjectReadOnly)
     {
         RandomizeEvent(nEvent);
     }
 }
Пример #2
0
 public TypeMemberCollection()
 {
     _fields     = new FieldCollection();
     _methods    = new MethodCollection();
     _properties = new PropertyCollection();
     _events     = new EventCollection();
 }
Пример #3
0
 //[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);
            }));
        }
Пример #5
0
        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);
        }
Пример #6
0
        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;
        }
Пример #7
0
 public EventCollectionHandlerCollection(IEventCollection <TKey, TValue> collection)
 {
     this.collection  = collection;
     internalHandlers = new List <KeyValuePair <object, IEventCollectionHandler <TKey, TValue> > >();
 }
Пример #8
0
 public ContextWrapped(IEventCollection <TKey, TValue> collection, object context)
 {
     this.collection = collection;
     this.context    = context;
 }