Skip to content

Commit

Permalink
Avoid property initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Oct 15, 2022
1 parent 0ec6886 commit c602b54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Bonsai.Core/Reactive/Concurrency/SchedulerMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public SchedulerMapping(IScheduler scheduler)
/// Gets or sets the scheduler object assigned to the mapping.
/// </summary>
[XmlIgnore]
public IScheduler Instance { get; set; }
public IScheduler Instance { get; private set; }

/// <summary>
/// Gets or sets an XML representation of the scheduler instance for serialization.
Expand Down
14 changes: 7 additions & 7 deletions Bonsai.Core/Reactive/Concurrency/SchedulerMappingConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using System.Globalization;
using Rx = System.Reactive.Concurrency;
Expand All @@ -10,12 +10,12 @@ internal class SchedulerMappingConverter : TypeConverter
static readonly SchedulerMapping[] DefaultSchedulers = new SchedulerMapping[]
{
new SchedulerMapping(),
new SchedulerMapping { Instance = Rx.DefaultScheduler.Instance },
new SchedulerMapping { Instance = Rx.CurrentThreadScheduler.Instance },
new SchedulerMapping { Instance = Rx.ImmediateScheduler.Instance },
new SchedulerMapping { Instance = Rx.ThreadPoolScheduler.Instance },
new SchedulerMapping { Instance = Rx.NewThreadScheduler.Default },
new SchedulerMapping { Instance = Rx.TaskPoolScheduler.Default },
new SchedulerMapping(Rx.DefaultScheduler.Instance),
new SchedulerMapping(Rx.CurrentThreadScheduler.Instance),
new SchedulerMapping(Rx.ImmediateScheduler.Instance),
new SchedulerMapping(Rx.ThreadPoolScheduler.Instance),
new SchedulerMapping(Rx.NewThreadScheduler.Default),
new SchedulerMapping(Rx.TaskPoolScheduler.Default),
};

public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Expand Down

0 comments on commit c602b54

Please sign in to comment.