コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReplaySubject{T}" /> class with the specified buffer size.
 /// </summary>
 /// <param name="bufferSize">Maximum element count of the replay buffer.</param>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="bufferSize"/> is less than zero.</exception>
 public ReplaySubject(int bufferSize)
 {
     _implementation = bufferSize switch
     {
         1 => new ReplayOne(),
         int.MaxValue => new ReplayAll(),
         _ => new ReplayMany(bufferSize),
     };
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="System.Reactive.Subjects.ReplaySubject&lt;T&gt;" /> class with the specified buffer size.
        /// </summary>
        /// <param name="bufferSize">Maximum element count of the replay buffer.</param>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="bufferSize"/> is less than zero.</exception>
        public ReplaySubject(int bufferSize)
        {
            switch (bufferSize)
            {
            case 1:
                _implementation = new ReplayOne();
                break;

            case int.MaxValue:
                _implementation = new ReplayAll();
                break;

            default:
                _implementation = new ReplayMany(bufferSize);
                break;
            }
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="System.Reactive.Subjects.ReplaySubject&lt;T&gt;" /> class with the specified window.
 /// </summary>
 /// <param name="window">Maximum time length of the replay buffer.</param>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="window"/> is less than TimeSpan.Zero.</exception>
 public ReplaySubject(TimeSpan window)
 {
     _implementation = new ReplayByTime(window);
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="System.Reactive.Subjects.ReplaySubject&lt;T&gt;" /> class with the specified buffer size and scheduler.
 /// </summary>
 /// <param name="bufferSize">Maximum element count of the replay buffer.</param>
 /// <param name="scheduler">Scheduler the observers are invoked on.</param>
 /// <exception cref="ArgumentNullException"><paramref name="scheduler"/> is null.</exception>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="bufferSize"/> is less than zero.</exception>
 public ReplaySubject(int bufferSize, IScheduler scheduler)
 {
     _implementation = new ReplayByTime(bufferSize, scheduler);
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="System.Reactive.Subjects.ReplaySubject&lt;T&gt;" /> class with the specified scheduler.
 /// </summary>
 /// <param name="scheduler">Scheduler the observers are invoked on.</param>
 /// <exception cref="ArgumentNullException"><paramref name="scheduler"/> is null.</exception>
 public ReplaySubject(IScheduler scheduler)
 {
     _implementation = new ReplayByTime(scheduler);
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="System.Reactive.Subjects.ReplaySubject&lt;T&gt;" /> class with the specified buffer size and window.
 /// </summary>
 /// <param name="bufferSize">Maximum element count of the replay buffer.</param>
 /// <param name="window">Maximum time length of the replay buffer.</param>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="bufferSize"/> is less than zero. -or- <paramref name="window"/> is less than TimeSpan.Zero.</exception>
 public ReplaySubject(int bufferSize, TimeSpan window)
 {
     _implementation = new ReplayByTime(bufferSize, window);
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="System.Reactive.Subjects.ReplaySubject&lt;T&gt;" /> class with the specified window and scheduler.
 /// </summary>
 /// <param name="window">Maximum time length of the replay buffer.</param>
 /// <param name="scheduler">Scheduler the observers are invoked on.</param>
 /// <exception cref="ArgumentNullException"><paramref name="scheduler"/> is null.</exception>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="window"/> is less than TimeSpan.Zero.</exception>
 public ReplaySubject(TimeSpan window, IScheduler scheduler)
 {
     _implementation = new ReplayByTime(window, scheduler);
 }