///<summary> /// Creates a new instance of <see cref="EventSubscription"/>. ///</summary> ///<param name="actionReference">A reference to a delegate of type <see cref="System.Action"/>.</param> ///<exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> ///<exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action"/>.</exception> public EventSubscription(IDelegateReference actionReference) { if (actionReference == null) throw new ArgumentNullException(nameof(actionReference)); if (!(actionReference.Target is Action)) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidDelegateRerefenceTypeException, typeof(Action).FullName), nameof(actionReference)); _actionReference = actionReference; }
public BackgroundMsgSubscription(IDelegateReference actionReference, IDelegateReference filterReference) : base(actionReference, filterReference) { }
///<summary> /// Creates a new instance of <see cref="BackgroundEventSubscription{TPayload}"/>. ///</summary> ///<param name="actionReference">A reference to a delegate of type <see cref="System.Action{TPayload}"/>.</param> ///<param name="filterReference">A reference to a delegate of type <see cref="Predicate{TPayload}"/>.</param> ///<param name="dispatcher">The dispatcher to use when executing the <paramref name="actionReference"/> delegate.</param> ///<exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> ///<exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action{TPayload}"/>, ///or the target of <paramref name="filterReference"/> is not of type <see cref="Predicate{TPayload}"/>.</exception> public DispatcherEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, Dispatcher dispatcher) : base(actionReference, filterReference) { this.dispatcher = dispatcher; }
/// <summary> /// Creates a new instance of <see cref="BackgroundEventSubscription"/>. /// </summary> /// <param name="actionReference">A reference to a delegate of type <see cref="System.Action"/>.</param> /// <exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> /// <exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action"/>.</exception> public BackgroundEventSubscription(IDelegateReference actionReference) : base(actionReference) { }
///<summary> /// Creates a new instance of <see cref="Common.PubSubEvents.BackgroundEventSubscription"/>. ///</summary> ///<param name="actionReference">A reference to a delegate of type <see cref="System.Action{TPayload}"/>.</param> ///<param name="context">The synchronization context to use for UI thread dispatching.</param> ///<exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> ///<exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action{TPayload}"/>.</exception> public DispatcherEventSubscription(IDelegateReference actionReference, SynchronizationContext context) : base(actionReference) { this._syncContext = context; }
public BackgroundDispatcherSubscription(IDelegateReference actionReference) : base(actionReference) { }
///<summary> /// Constructor padrão. ///</summary> ///<param name="actionReference">Referência para um delegate do tipo <see cref="System.Action{TPayload}"/>.</param> ///<param name="filterReference">Referência para um delegate do tipo <see cref="Predicate{TPayload}"/>.</param> ///<param name="allowCallReentrance">Identifica se a instancia irá permitir reentrada de chamada.</param> ///<param name="dispatcher">Despachante que será usado na instancia.</param> ///<param name="name">Nome da assinatura.</param> public DispatcherEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, bool allowCallReentrance, Threading.IDispatcher dispatcher, string name = null) : base(actionReference, filterReference, allowCallReentrance, name) { dispatcher.Require("dispatcher").NotNull(); _dispatcher = dispatcher; }
public DispatcherEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, SynchronizationContext syncContext) : base(actionReference, filterReference) { this.syncContext = syncContext; }
///<summary> /// Creates a new instance of <see cref="BackgroundEventSubscription"/>. ///</summary> ///<param name="actionReference">A reference to a delegate of type <see cref="System.Action{TPayload}"/>.</param> ///<param name="context">The synchronization context to use for UI thread dispatching.</param> ///<exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> ///<exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action{TPayload}"/>.</exception> public DispatcherEventSubscription(IDelegateReference actionReference, SynchronizationContext context) : base(actionReference) { syncContext = context; }
///<summary> /// Creates a new instance of <see cref="BackgroundEventSubscription{TPayload}"/>. ///</summary> ///<param name="actionReference">A reference to a delegate of type <see cref="System.Action{TPayload}"/>.</param> ///<param name="filterReference">A reference to a delegate of type <see cref="Predicate{TPayload}"/>.</param> ///<param name="dispatcher">The dispatcher to use when executing the <paramref name="actionReference"/> delegate.</param> ///<exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> ///<exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action{TPayload}"/>, ///or the target of <paramref name="filterReference"/> is not of type <see cref="Predicate{TPayload}"/>.</exception> public WinFormEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, IDispatcherFacade dispatcher) : base(actionReference, filterReference) { this.dispatcher = dispatcher; }
/// <summary> /// Initializes a new instance of the <see cref="CiEventSubscription{TPayload}"/> class. /// </summary> /// <param name="actionReference">The action reference.</param> /// <param name="filterReference">The filter reference.</param> public CiEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference) : base(actionReference, filterReference) { }
public DispatcherEventSubscription(IDelegateReference actionReference) : base(actionReference) { UIDispatcher = Dispatcher.CurrentDispatcher; }
/// <summary> /// Initializes a new instance of the <see cref="CiDispatcherEventSubscription{TPayload}"/> class. /// </summary> /// <param name="actionReference">The action reference.</param> /// <param name="filterReference">The filter reference.</param> /// <param name="context">The context.</param> public CiDispatcherEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, SynchronizationContext context) : base(actionReference, filterReference, context) { _syncContext = context; }
public ContextDispatcherSubscription(IDelegateReference actionReference, SynchronizationContext context) : base(actionReference) { m_context = context; }
///<summary> /// Creates a new instance of <see cref="BackgroundEventSubscription{TPayload}"/>. ///</summary> ///<param name="actionReference">A reference to a delegate of type <see cref="System.Action{TPayload}"/>.</param> ///<param name="filterReference">A reference to a delegate of type <see cref="Predicate{TPayload}"/>.</param> ///<param name="dispatcher">The dispatcher to use when executing the <paramref name="actionReference"/> delegate.</param> ///<exception cref="ArgumentNullException">When <paramref name="actionReference"/> or <see paramref="filterReference"/> are <see langword="null" />.</exception> ///<exception cref="ArgumentException">When the target of <paramref name="actionReference"/> is not of type <see cref="System.Action{TPayload}"/>, ///or the target of <paramref name="filterReference"/> is not of type <see cref="Predicate{TPayload}"/>.</exception> public CompositeEventSubscription(IDelegateReference actionReference, IDelegateReference filterReference, SynchronizationContext context) : base(actionReference, filterReference) { _context = context; }